{ "version": 3, "sources": ["../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/adapters.js", "../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/logger.js", "../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/connection_monitor.js", "../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/internal.js", "../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/connection.js", "../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/subscription.js", "../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/subscription_guarantor.js", "../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/subscriptions.js", "../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/consumer.js", "../../../node_modules/.pnpm/@rails+actioncable@7.2.201/node_modules/@rails/actioncable/src/index.js", "../../../node_modules/.pnpm/croppie@2.6.5/node_modules/croppie/croppie.js", "../../../node_modules/.pnpm/compressorjs@1.2.1/node_modules/compressorjs/dist/compressor.js", "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js", "../../../node_modules/.pnpm/@hotwired+turbo@8.0.12/node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js", "../../../node_modules/.pnpm/@hotwired+turbo-rails@8.0.12/node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js", "../../../node_modules/.pnpm/@hotwired+turbo-rails@8.0.12/node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js", "../../../node_modules/.pnpm/@hotwired+turbo-rails@8.0.12/node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js", "../../../node_modules/.pnpm/@hotwired+turbo-rails@8.0.12/node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js", "../../../node_modules/.pnpm/@hotwired+turbo-rails@8.0.12/node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js", "../../../node_modules/.pnpm/@rails+activestorage@7.2.201/node_modules/@rails/activestorage/app/assets/javascripts/activestorage.esm.js", "../../../node_modules/.pnpm/@hotwired+stimulus@3.2.2/node_modules/@hotwired/stimulus/dist/stimulus.js", "../../javascript/controllers/application.js", "../../../node_modules/.pnpm/el-transition@0.0.7/node_modules/el-transition/index.js", "../../javascript/controllers/app_controller.js", "../../javascript/controllers/award_form_controller.js", "../../../node_modules/.pnpm/chart.js@3.9.1/node_modules/chart.js/dist/chunks/helpers.segment.mjs", "../../../node_modules/.pnpm/chart.js@3.9.1/node_modules/chart.js/dist/chart.mjs", "../../javascript/utils/math-utils.js", "../../javascript/utils/weight-utils.js", "../../javascript/controllers/chart_controller.js", "../../../node_modules/.pnpm/stimulus-checkbox-select-all@5.3.0_@hotwired+stimulus@3.2.2/node_modules/stimulus-checkbox-select-all/dist/stimulus-checkbox-select-all.mjs", "../../../node_modules/.pnpm/flatpickr@4.6.13/node_modules/flatpickr/dist/esm/types/options.js", "../../../node_modules/.pnpm/flatpickr@4.6.13/node_modules/flatpickr/dist/esm/l10n/default.js", "../../../node_modules/.pnpm/flatpickr@4.6.13/node_modules/flatpickr/dist/esm/utils/index.js", "../../../node_modules/.pnpm/flatpickr@4.6.13/node_modules/flatpickr/dist/esm/utils/dom.js", "../../../node_modules/.pnpm/flatpickr@4.6.13/node_modules/flatpickr/dist/esm/utils/formatting.js", "../../../node_modules/.pnpm/flatpickr@4.6.13/node_modules/flatpickr/dist/esm/utils/dates.js", "../../../node_modules/.pnpm/flatpickr@4.6.13/node_modules/flatpickr/dist/esm/utils/polyfills.js", "../../../node_modules/.pnpm/flatpickr@4.6.13/node_modules/flatpickr/dist/esm/index.js", "../../../node_modules/.pnpm/stimulus-flatpickr@3.0.0-0_flatpickr@4.6.13/node_modules/stimulus-flatpickr/node_modules/@hotwired/stimulus/dist/stimulus.js", "../../../node_modules/.pnpm/stimulus-flatpickr@3.0.0-0_flatpickr@4.6.13/node_modules/stimulus-flatpickr/src/utils.js", "../../../node_modules/.pnpm/stimulus-flatpickr@3.0.0-0_flatpickr@4.6.13/node_modules/stimulus-flatpickr/src/config_options.js", "../../../node_modules/.pnpm/stimulus-flatpickr@3.0.0-0_flatpickr@4.6.13/node_modules/stimulus-flatpickr/src/events.js", "../../../node_modules/.pnpm/stimulus-flatpickr@3.0.0-0_flatpickr@4.6.13/node_modules/stimulus-flatpickr/src/elements.js", "../../../node_modules/.pnpm/stimulus-flatpickr@3.0.0-0_flatpickr@4.6.13/node_modules/stimulus-flatpickr/src/strftime_mapping.js", "../../../node_modules/.pnpm/stimulus-flatpickr@3.0.0-0_flatpickr@4.6.13/node_modules/stimulus-flatpickr/src/index.js", "../../../node_modules/.pnpm/@rails+request.js@0.0.9/node_modules/@rails/request.js/src/fetch_response.js", "../../../node_modules/.pnpm/@rails+request.js@0.0.9/node_modules/@rails/request.js/src/request_interceptor.js", "../../../node_modules/.pnpm/@rails+request.js@0.0.9/node_modules/@rails/request.js/src/lib/utils.js", "../../../node_modules/.pnpm/@rails+request.js@0.0.9/node_modules/@rails/request.js/src/fetch_request.js", "../../../node_modules/.pnpm/@rails+request.js@0.0.9/node_modules/@rails/request.js/src/verbs.js", "../../../node_modules/.pnpm/stimulus-use@0.52.3_@hotwired+stimulus@3.2.2_hotkeys-js@3.13.9/node_modules/stimulus-use/dist/index.js", "../../javascript/controllers/command_palette_controller.ts", "../../javascript/controllers/custom_field_form.js", "../../javascript/controllers/dashboard_controller.ts", "../../javascript/controllers/date_filter_controller.ts", "../../javascript/controllers/filters_controller.js", "../../../node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.mjs", "../../javascript/fireworks.ts", "../../javascript/controllers/fireworks_controller.ts", "../../javascript/controllers/grouped_select_controller.js", "../../javascript/controllers/nested_form_controller.ts", "../../../node_modules/.pnpm/form-request-submit-polyfill@2.0.0/node_modules/form-request-submit-polyfill/form-request-submit-polyfill.js", "../../javascript/controllers/message_composer_controller.ts", "../../javascript/controllers/messages_list_controller.ts", "../../javascript/controllers/note_composer_controller.ts", "../../../node_modules/.pnpm/hotkeys-js@3.13.9/node_modules/hotkeys-js/dist/hotkeys.esm.js", "../../../node_modules/.pnpm/stimulus-use@0.51.3_@hotwired+stimulus@3.2.2/node_modules/stimulus-use/dist/index.js", "../../../node_modules/.pnpm/stimulus-notification@2.2.0_@hotwired+stimulus@3.2.2/node_modules/stimulus-notification/dist/stimulus-notification.mjs", "../../javascript/controllers/permissions_controller.js", "../../javascript/controllers/search_form_controller.js", "../../../node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js", "../../javascript/controllers/sortable_controller.js", "../../javascript/controllers/transition_controller.ts", "../../javascript/controllers/turbo_controller.js", "../../javascript/controllers/turbo_modal_controller.js", "../../javascript/controllers/cancellation_form_controller.ts", "../../javascript/controllers/current_conversation_controller.ts", "../../javascript/controllers/dropdown_controller.ts", "../../../node_modules/.pnpm/@stimulus-library+utilities@1.2.1/node_modules/@stimulus-library/utilities/dist/logging.js", "../../../node_modules/.pnpm/@stimulus-library+utilities@1.2.1/node_modules/@stimulus-library/utilities/dist/events.js", "../../../node_modules/.pnpm/@stimulus-library+utilities@1.2.1/node_modules/@stimulus-library/utilities/dist/base_controller.js", "../../../node_modules/.pnpm/@stimulus-library+utilities@1.2.1/node_modules/@stimulus-library/utilities/dist/arrays.js", "../../../node_modules/.pnpm/@stimulus-library+utilities@1.2.1/node_modules/@stimulus-library/utilities/dist/debounce.js", "../../../node_modules/.pnpm/@stimulus-library+utilities@1.2.1/node_modules/@stimulus-library/utilities/dist/easing_functions.js", "../../../node_modules/.pnpm/@stimulus-library+utilities@1.2.1/node_modules/@stimulus-library/utilities/dist/elements.js", "../../../node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/src/index.ts", "../../../node_modules/.pnpm/@stimulus-library+utilities@1.2.1/node_modules/@stimulus-library/utilities/dist/event_bus.js", "../../../node_modules/.pnpm/@stimulus-library+utilities@1.2.1/node_modules/@stimulus-library/utilities/dist/get_set.js", "../../../node_modules/.pnpm/@stimulus-library+mixins@1.2.2/node_modules/@stimulus-library/mixins/dist/use_mixin.js", "../../../node_modules/.pnpm/@stimulus-library+mixins@1.2.2/node_modules/@stimulus-library/mixins/dist/use_event_listener.js", "../../../node_modules/.pnpm/@stimulus-library+mixins@1.2.2/node_modules/@stimulus-library/mixins/dist/use_intersection.js", "../../../node_modules/.pnpm/@stimulus-library+mixins@1.2.2/node_modules/@stimulus-library/mixins/dist/use_timeout.js", "../../../node_modules/.pnpm/@stimulus-library+controllers@1.2.2/node_modules/@stimulus-library/controllers/dist/forms/autosize_controller.js", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/toDate.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructFrom.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/addDays.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/addMonths.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/add.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constants.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfDay.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInCalendarDays.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInDays.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/getRoundingMethod.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInMilliseconds.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInHours.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInMinutes.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/compareAsc.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInCalendarMonths.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/endOfDay.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/endOfMonth.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isLastDayOfMonth.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInMonths.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInSeconds.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInCalendarYears.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInYears.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/intervalToDuration.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isPast.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/localize.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/match.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/defaultOptions.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructNow.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/formatDistance.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/formatDistanceToNow.mjs", "../../../node_modules/.pnpm/@stimulus-library+controllers@1.2.2/node_modules/@stimulus-library/controllers/dist/visual/time_distance_controller.js", "../../javascript/controllers/weigh_in_controller.ts", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/enums.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/math.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/userAgent.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/within.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/getVariation.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/flip.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/hide.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/offset.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/debounce.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/createPopper.js", "../../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/popper.js", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/constants.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/utils.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/dom-utils.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/bindGlobalEventListeners.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/browser.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/validation.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/props.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/template.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/createTippy.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/index.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/addons/createSingleton.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/addons/delegate.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/plugins/animateFill.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/plugins/followCursor.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/plugins/inlinePositioning.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/src/plugins/sticky.ts", "../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/build/base.js", "../../javascript/controllers/tooltip_controller.ts", "../../javascript/controllers/modal_controller.ts", "../../javascript/controllers/avatar_picker_controller.ts", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/constants.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/util.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/options.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/create-element.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/component.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/diff/props.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/create-context.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/diff/children.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/diff/index.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/render.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/clone-element.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/src/diff/catch-error.js", "../../../node_modules/.pnpm/preact@10.25.4/node_modules/preact/hooks/src/index.js", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeek.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeek.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeekYear.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeekYear.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/addWeeks.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isSameDay.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isDate.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isValid.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfYear.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDayOfYear.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeek.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeekYear.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeekYear.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeek.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/addLeadingZeros.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/lightFormatters.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/formatters.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/longFormatters.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/protectedTokens.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/format.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDay.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isAfter.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isBefore.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isSameWeek.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isSameMonth.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isThisWeek.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isToday.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isTomorrow.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/subDays.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/nextDay.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/nextMonday.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/previousDay.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/previousMonday.mjs", "../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfTomorrow.mjs", "../../javascript/components/WeekPicker/PreviousMonthButton.tsx", "../../javascript/components/WeekPicker/NextMonthButton.tsx", "../../javascript/components/WeekPicker/WeekRow.tsx", "../../javascript/components/WeekPicker.tsx", "../../javascript/controllers/week_filter_controller.tsx", "../../javascript/controllers/scroll_to_bottom_controller.ts", "../../../node_modules/.pnpm/@editorjs+editorjs@2.30.8/node_modules/@editorjs/editorjs/dist/editorjs.mjs", "../../../node_modules/.pnpm/@editorjs+header@2.8.8/node_modules/@editorjs/header/dist/header.mjs", "../../../node_modules/.pnpm/@editorjs+list@1.10.0/node_modules/@editorjs/list/dist/list.mjs", "../../../node_modules/.pnpm/@editorjs+quote@2.7.6/node_modules/@editorjs/quote/dist/quote.mjs", "../../../node_modules/.pnpm/@editorjs+image@2.10.1/node_modules/@editorjs/image/dist/image.mjs", "../../../node_modules/.pnpm/@editorjs+embed@2.7.6/node_modules/@editorjs/embed/dist/embed.mjs", "../../../node_modules/.pnpm/@editorjs+table@2.4.3/node_modules/@editorjs/table/dist/table.mjs", "../../../node_modules/.pnpm/@editorjs+underline@1.2.1/node_modules/@editorjs/underline/dist/underline.mjs", "../../../node_modules/.pnpm/@editorjs+link@2.6.2/node_modules/@editorjs/link/dist/link.mjs", "../../javascript/controllers/editor_controller.ts", "../../javascript/controllers/article_form_controller.ts", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/constants.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/helpers.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/defaults.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/dropdown.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/suggestions.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/persist.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/texts.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/templates.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/events.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/tagify.js", "../../../node_modules/.pnpm/@yaireo+tagify@4.33.2_prop-types@15.8.1_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@yaireo/tagify/dist/src/parts/EventDispatcher.js", "../../javascript/controllers/tags_controller.ts", "../../javascript/controllers/toggle-content-controller.ts", "../../javascript/controllers/checkbox_button_controller.ts", "../../javascript/components/DateTimePicker/WeekRow.tsx", "../../javascript/components/DateTimePicker.tsx", "../../javascript/controllers/date_time_picker_controller.tsx", "../../javascript/controllers/consultant-portal/tasks/assignee_picker_controller.ts", "../../javascript/controllers/consultant-portal/auto-submit-controller.ts", "../../javascript/controllers/link-controller.ts", "../../javascript/controllers/index.js", "../../javascript/stream-actions/browser.ts", "../../javascript/stream-actions/dom.js", "../../javascript/stream-actions/turbo.js", "../../javascript/application.js"], "sourcesContent": ["export default {\n logger: typeof console !== \"undefined\" ? console : undefined,\n WebSocket: typeof WebSocket !== \"undefined\" ? WebSocket : undefined,\n}\n", "import adapters from \"./adapters\"\n\n// The logger is disabled by default. You can enable it with:\n//\n// ActionCable.logger.enabled = true\n//\n// Example:\n//\n// import * as ActionCable from '@rails/actioncable'\n//\n// ActionCable.logger.enabled = true\n// ActionCable.logger.log('Connection Established.')\n//\n\nexport default {\n log(...messages) {\n if (this.enabled) {\n messages.push(Date.now())\n adapters.logger.log(\"[ActionCable]\", ...messages)\n }\n },\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring the cable connection is in good health by validating the heartbeat pings sent from the server, and attempting\n// revival reconnections if things go astray. Internal class, not intended for direct user manipulation.\n\nconst now = () => new Date().getTime()\n\nconst secondsSince = time => (now() - time) / 1000\n\nclass ConnectionMonitor {\n constructor(connection) {\n this.visibilityDidChange = this.visibilityDidChange.bind(this)\n this.connection = connection\n this.reconnectAttempts = 0\n }\n\n start() {\n if (!this.isRunning()) {\n this.startedAt = now()\n delete this.stoppedAt\n this.startPolling()\n addEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`)\n }\n }\n\n stop() {\n if (this.isRunning()) {\n this.stoppedAt = now()\n this.stopPolling()\n removeEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(\"ConnectionMonitor stopped\")\n }\n }\n\n isRunning() {\n return this.startedAt && !this.stoppedAt\n }\n\n recordMessage() {\n this.pingedAt = now()\n }\n\n recordConnect() {\n this.reconnectAttempts = 0\n delete this.disconnectedAt\n logger.log(\"ConnectionMonitor recorded connect\")\n }\n\n recordDisconnect() {\n this.disconnectedAt = now()\n logger.log(\"ConnectionMonitor recorded disconnect\")\n }\n\n // Private\n\n startPolling() {\n this.stopPolling()\n this.poll()\n }\n\n stopPolling() {\n clearTimeout(this.pollTimeout)\n }\n\n poll() {\n this.pollTimeout = setTimeout(() => {\n this.reconnectIfStale()\n this.poll()\n }\n , this.getPollInterval())\n }\n\n getPollInterval() {\n const { staleThreshold, reconnectionBackoffRate } = this.constructor\n const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10))\n const jitterMax = this.reconnectAttempts === 0 ? 1.0 : reconnectionBackoffRate\n const jitter = jitterMax * Math.random()\n return staleThreshold * 1000 * backoff * (1 + jitter)\n }\n\n reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`)\n this.reconnectAttempts++\n if (this.disconnectedRecently()) {\n logger.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`)\n } else {\n logger.log(\"ConnectionMonitor reopening\")\n this.connection.reopen()\n }\n }\n }\n\n get refreshedAt() {\n return this.pingedAt ? this.pingedAt : this.startedAt\n }\n\n connectionIsStale() {\n return secondsSince(this.refreshedAt) > this.constructor.staleThreshold\n }\n\n disconnectedRecently() {\n return this.disconnectedAt && (secondsSince(this.disconnectedAt) < this.constructor.staleThreshold)\n }\n\n visibilityDidChange() {\n if (document.visibilityState === \"visible\") {\n setTimeout(() => {\n if (this.connectionIsStale() || !this.connection.isOpen()) {\n logger.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`)\n this.connection.reopen()\n }\n }\n , 200)\n }\n }\n\n}\n\nConnectionMonitor.staleThreshold = 6 // Server::Connections::BEAT_INTERVAL * 2 (missed two pings)\nConnectionMonitor.reconnectionBackoffRate = 0.15\n\nexport default ConnectionMonitor\n", "export default {\n \"message_types\": {\n \"welcome\": \"welcome\",\n \"disconnect\": \"disconnect\",\n \"ping\": \"ping\",\n \"confirmation\": \"confirm_subscription\",\n \"rejection\": \"reject_subscription\"\n },\n \"disconnect_reasons\": {\n \"unauthorized\": \"unauthorized\",\n \"invalid_request\": \"invalid_request\",\n \"server_restart\": \"server_restart\",\n \"remote\": \"remote\"\n },\n \"default_mount_path\": \"/cable\",\n \"protocols\": [\n \"actioncable-v1-json\",\n \"actioncable-unsupported\"\n ]\n}\n", "import adapters from \"./adapters\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport INTERNAL from \"./internal\"\nimport logger from \"./logger\"\n\n// Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.\n\nconst {message_types, protocols} = INTERNAL\nconst supportedProtocols = protocols.slice(0, protocols.length - 1)\n\nconst indexOf = [].indexOf\n\nclass Connection {\n constructor(consumer) {\n this.open = this.open.bind(this)\n this.consumer = consumer\n this.subscriptions = this.consumer.subscriptions\n this.monitor = new ConnectionMonitor(this)\n this.disconnected = true\n }\n\n send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data))\n return true\n } else {\n return false\n }\n }\n\n open() {\n if (this.isActive()) {\n logger.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`)\n return false\n } else {\n const socketProtocols = [...protocols, ...this.consumer.subprotocols || []]\n logger.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${socketProtocols}`)\n if (this.webSocket) { this.uninstallEventHandlers() }\n this.webSocket = new adapters.WebSocket(this.consumer.url, socketProtocols)\n this.installEventHandlers()\n this.monitor.start()\n return true\n }\n }\n\n close({allowReconnect} = {allowReconnect: true}) {\n if (!allowReconnect) { this.monitor.stop() }\n // Avoid closing websockets in a \"connecting\" state due to Safari 15.1+ bug. See: https://github.com/rails/rails/issues/43835#issuecomment-1002288478\n if (this.isOpen()) {\n return this.webSocket.close()\n }\n }\n\n reopen() {\n logger.log(`Reopening WebSocket, current state is ${this.getState()}`)\n if (this.isActive()) {\n try {\n return this.close()\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error)\n }\n finally {\n logger.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`)\n setTimeout(this.open, this.constructor.reopenDelay)\n }\n } else {\n return this.open()\n }\n }\n\n getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol\n }\n }\n\n isOpen() {\n return this.isState(\"open\")\n }\n\n isActive() {\n return this.isState(\"open\", \"connecting\")\n }\n\n triedToReconnect() {\n return this.monitor.reconnectAttempts > 0\n }\n\n // Private\n\n isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0\n }\n\n isState(...states) {\n return indexOf.call(states, this.getState()) >= 0\n }\n\n getState() {\n if (this.webSocket) {\n for (let state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase()\n }\n }\n }\n return null\n }\n\n installEventHandlers() {\n for (let eventName in this.events) {\n const handler = this.events[eventName].bind(this)\n this.webSocket[`on${eventName}`] = handler\n }\n }\n\n uninstallEventHandlers() {\n for (let eventName in this.events) {\n this.webSocket[`on${eventName}`] = function() {}\n }\n }\n\n}\n\nConnection.reopenDelay = 500\n\nConnection.prototype.events = {\n message(event) {\n if (!this.isProtocolSupported()) { return }\n const {identifier, message, reason, reconnect, type} = JSON.parse(event.data)\n this.monitor.recordMessage()\n switch (type) {\n case message_types.welcome:\n if (this.triedToReconnect()) {\n this.reconnectAttempted = true\n }\n this.monitor.recordConnect()\n return this.subscriptions.reload()\n case message_types.disconnect:\n logger.log(`Disconnecting. Reason: ${reason}`)\n return this.close({allowReconnect: reconnect})\n case message_types.ping:\n return null\n case message_types.confirmation:\n this.subscriptions.confirmSubscription(identifier)\n if (this.reconnectAttempted) {\n this.reconnectAttempted = false\n return this.subscriptions.notify(identifier, \"connected\", {reconnected: true})\n } else {\n return this.subscriptions.notify(identifier, \"connected\", {reconnected: false})\n }\n case message_types.rejection:\n return this.subscriptions.reject(identifier)\n default:\n return this.subscriptions.notify(identifier, \"received\", message)\n }\n },\n\n open() {\n logger.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`)\n this.disconnected = false\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\")\n return this.close({allowReconnect: false})\n }\n },\n\n close(event) {\n logger.log(\"WebSocket onclose event\")\n if (this.disconnected) { return }\n this.disconnected = true\n this.monitor.recordDisconnect()\n return this.subscriptions.notifyAll(\"disconnected\", {willAttemptReconnect: this.monitor.isRunning()})\n },\n\n error() {\n logger.log(\"WebSocket onerror event\")\n }\n}\n\nexport default Connection\n", "// A new subscription is created through the ActionCable.Subscriptions instance available on the consumer.\n// It provides a number of callbacks and a method for calling remote procedure calls on the corresponding\n// Channel instance on the server side.\n//\n// An example demonstrates the basic functionality:\n//\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\", {\n// connected() {\n// // Called once the subscription has been successfully completed\n// },\n//\n// disconnected({ willAttemptReconnect: boolean }) {\n// // Called when the client has disconnected with the server.\n// // The object will have an `willAttemptReconnect` property which\n// // says whether the client has the intention of attempting\n// // to reconnect.\n// },\n//\n// appear() {\n// this.perform('appear', {appearing_on: this.appearingOn()})\n// },\n//\n// away() {\n// this.perform('away')\n// },\n//\n// appearingOn() {\n// $('main').data('appearing-on')\n// }\n// })\n//\n// The methods #appear and #away forward their intent to the remote AppearanceChannel instance on the server\n// by calling the `perform` method with the first parameter being the action (which maps to AppearanceChannel#appear/away).\n// The second parameter is a hash that'll get JSON encoded and made available on the server in the data parameter.\n//\n// This is how the server component would look:\n//\n// class AppearanceChannel < ApplicationActionCable::Channel\n// def subscribed\n// current_user.appear\n// end\n//\n// def unsubscribed\n// current_user.disappear\n// end\n//\n// def appear(data)\n// current_user.appear on: data['appearing_on']\n// end\n//\n// def away\n// current_user.away\n// end\n// end\n//\n// The \"AppearanceChannel\" name is automatically mapped between the client-side subscription creation and the server-side Ruby class name.\n// The AppearanceChannel#appear/away public methods are exposed automatically to client-side invocation through the perform method.\n\nconst extend = function(object, properties) {\n if (properties != null) {\n for (let key in properties) {\n const value = properties[key]\n object[key] = value\n }\n }\n return object\n}\n\nexport default class Subscription {\n constructor(consumer, params = {}, mixin) {\n this.consumer = consumer\n this.identifier = JSON.stringify(params)\n extend(this, mixin)\n }\n\n // Perform a channel action with the optional data passed as an attribute\n perform(action, data = {}) {\n data.action = action\n return this.send(data)\n }\n\n send(data) {\n return this.consumer.send({command: \"message\", identifier: this.identifier, data: JSON.stringify(data)})\n }\n\n unsubscribe() {\n return this.consumer.subscriptions.remove(this)\n }\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring channel subscribe command is confirmed, retrying until confirmation is received.\n// Internal class, not intended for direct user manipulation.\n\nclass SubscriptionGuarantor {\n constructor(subscriptions) {\n this.subscriptions = subscriptions\n this.pendingSubscriptions = []\n }\n\n guarantee(subscription) {\n if(this.pendingSubscriptions.indexOf(subscription) == -1){ \n logger.log(`SubscriptionGuarantor guaranteeing ${subscription.identifier}`)\n this.pendingSubscriptions.push(subscription) \n }\n else {\n logger.log(`SubscriptionGuarantor already guaranteeing ${subscription.identifier}`)\n }\n this.startGuaranteeing()\n }\n\n forget(subscription) {\n logger.log(`SubscriptionGuarantor forgetting ${subscription.identifier}`)\n this.pendingSubscriptions = (this.pendingSubscriptions.filter((s) => s !== subscription))\n }\n\n startGuaranteeing() {\n this.stopGuaranteeing()\n this.retrySubscribing()\n }\n \n stopGuaranteeing() {\n clearTimeout(this.retryTimeout)\n }\n\n retrySubscribing() {\n this.retryTimeout = setTimeout(() => {\n if (this.subscriptions && typeof(this.subscriptions.subscribe) === \"function\") {\n this.pendingSubscriptions.map((subscription) => {\n logger.log(`SubscriptionGuarantor resubscribing ${subscription.identifier}`)\n this.subscriptions.subscribe(subscription)\n })\n }\n }\n , 500)\n }\n}\n\nexport default SubscriptionGuarantor", "import Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport logger from \"./logger\"\n\n// Collection class for creating (and internally managing) channel subscriptions.\n// The only method intended to be triggered by the user is ActionCable.Subscriptions#create,\n// and it should be called through the consumer like so:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n\nexport default class Subscriptions {\n constructor(consumer) {\n this.consumer = consumer\n this.guarantor = new SubscriptionGuarantor(this)\n this.subscriptions = []\n }\n\n create(channelName, mixin) {\n const channel = channelName\n const params = typeof channel === \"object\" ? channel : {channel}\n const subscription = new Subscription(this.consumer, params, mixin)\n return this.add(subscription)\n }\n\n // Private\n\n add(subscription) {\n this.subscriptions.push(subscription)\n this.consumer.ensureActiveConnection()\n this.notify(subscription, \"initialized\")\n this.subscribe(subscription)\n return subscription\n }\n\n remove(subscription) {\n this.forget(subscription)\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\")\n }\n return subscription\n }\n\n reject(identifier) {\n return this.findAll(identifier).map((subscription) => {\n this.forget(subscription)\n this.notify(subscription, \"rejected\")\n return subscription\n })\n }\n\n forget(subscription) {\n this.guarantor.forget(subscription)\n this.subscriptions = (this.subscriptions.filter((s) => s !== subscription))\n return subscription\n }\n\n findAll(identifier) {\n return this.subscriptions.filter((s) => s.identifier === identifier)\n }\n\n reload() {\n return this.subscriptions.map((subscription) =>\n this.subscribe(subscription))\n }\n\n notifyAll(callbackName, ...args) {\n return this.subscriptions.map((subscription) =>\n this.notify(subscription, callbackName, ...args))\n }\n\n notify(subscription, callbackName, ...args) {\n let subscriptions\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription)\n } else {\n subscriptions = [subscription]\n }\n\n return subscriptions.map((subscription) =>\n (typeof subscription[callbackName] === \"function\" ? subscription[callbackName](...args) : undefined))\n }\n\n subscribe(subscription) {\n if (this.sendCommand(subscription, \"subscribe\")) {\n this.guarantor.guarantee(subscription)\n }\n }\n\n confirmSubscription(identifier) {\n logger.log(`Subscription confirmed ${identifier}`)\n this.findAll(identifier).map((subscription) =>\n this.guarantor.forget(subscription))\n }\n\n sendCommand(subscription, command) {\n const {identifier} = subscription\n return this.consumer.send({command, identifier})\n }\n}\n", "import Connection from \"./connection\"\nimport Subscriptions from \"./subscriptions\"\n\n// The ActionCable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,\n// the ActionCable.ConnectionMonitor will ensure that its properly maintained through heartbeats and checking for stale updates.\n// The Consumer instance is also the gateway to establishing subscriptions to desired channels through the #createSubscription\n// method.\n//\n// The following example shows how this can be set up:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n//\n// When a consumer is created, it automatically connects with the server.\n//\n// To disconnect from the server, call\n//\n// App.cable.disconnect()\n//\n// and to restart the connection:\n//\n// App.cable.connect()\n//\n// Any channel subscriptions which existed prior to disconnecting will\n// automatically resubscribe.\n\nexport default class Consumer {\n constructor(url) {\n this._url = url\n this.subscriptions = new Subscriptions(this)\n this.connection = new Connection(this)\n this.subprotocols = []\n }\n\n get url() {\n return createWebSocketURL(this._url)\n }\n\n send(data) {\n return this.connection.send(data)\n }\n\n connect() {\n return this.connection.open()\n }\n\n disconnect() {\n return this.connection.close({allowReconnect: false})\n }\n\n ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open()\n }\n }\n\n addSubProtocol(subprotocol) {\n this.subprotocols = [...this.subprotocols, subprotocol]\n }\n}\n\nexport function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url()\n }\n\n if (url && !/^wss?:/i.test(url)) {\n const a = document.createElement(\"a\")\n a.href = url\n // Fix populating Location properties in IE. Otherwise, protocol will be blank.\n a.href = a.href\n a.protocol = a.protocol.replace(\"http\", \"ws\")\n return a.href\n } else {\n return url\n }\n}\n", "import Connection from \"./connection\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport Consumer, { createWebSocketURL } from \"./consumer\"\nimport INTERNAL from \"./internal\"\nimport Subscription from \"./subscription\"\nimport Subscriptions from \"./subscriptions\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport adapters from \"./adapters\"\nimport logger from \"./logger\"\n\nexport {\n Connection,\n ConnectionMonitor,\n Consumer,\n INTERNAL,\n Subscription,\n Subscriptions,\n SubscriptionGuarantor,\n adapters,\n createWebSocketURL,\n logger,\n}\n\nexport function createConsumer(url = getConfig(\"url\") || INTERNAL.default_mount_path) {\n return new Consumer(url)\n}\n\nexport function getConfig(name) {\n const element = document.head.querySelector(`meta[name='action-cable-${name}']`)\n if (element) {\n return element.getAttribute(\"content\")\n }\n}\n", "/*************************\r\n * Croppie\r\n * Copyright 2019\r\n * Foliotek\r\n * Version: 2.6.5\r\n *************************/\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD. Register as an anonymous module.\r\n define(factory);\r\n } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {\r\n // CommonJS\r\n module.exports = factory();\r\n } else {\r\n // Browser globals\r\n root.Croppie = factory();\r\n }\r\n}(typeof self !== 'undefined' ? self : this, function () {\r\n\r\n /* Polyfills */\r\n if (typeof Promise !== 'function') {\r\n /*! promise-polyfill 3.1.0 */\r\n !function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if(\"object\"!==typeof this)throw new TypeError(\"Promises must be constructed via new\");if(\"function\"!==typeof a)throw new TypeError(\"not a function\");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void k(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError(\"A promise cannot be resolved with itself.\");if(a&&(\"object\"===typeof a||\"function\"===typeof a)){var c=a.then;if(\"function\"===typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled=\"function\"===typeof a?a:null,this.onRejected=\"function\"===typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j=setTimeout,k=\"function\"===typeof setImmediate&&setImmediate||function(a){j(a,1)},l=Array.isArray||function(a){return\"[object Array]\"===Object.prototype.toString.call(a)};c.prototype[\"catch\"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&(\"object\"===typeof g||\"function\"===typeof g)){var h=g.then;if(\"function\"===typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;f<a.length;f++)d(f,a[f])})},c.resolve=function(a){return a&&\"object\"===typeof a&&a.constructor===c?a:new c(function(b){b(a)})},c.reject=function(a){return new c(function(b,c){c(a)})},c.race=function(a){return new c(function(b,c){for(var d=0,e=a.length;e>d;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){k=a},\"undefined\"!==typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);\r\n }\r\n\r\n if (typeof window !== 'undefined' && typeof window.CustomEvent !== \"function\") {\r\n (function(){\r\n function CustomEvent ( event, params ) {\r\n params = params || { bubbles: false, cancelable: false, detail: undefined };\r\n var evt = document.createEvent( 'CustomEvent' );\r\n evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );\r\n return evt;\r\n }\r\n CustomEvent.prototype = window.Event.prototype;\r\n window.CustomEvent = CustomEvent;\r\n }());\r\n }\r\n\r\n if (typeof HTMLCanvasElement !== 'undefined' && !HTMLCanvasElement.prototype.toBlob) {\r\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\r\n value: function (callback, type, quality) {\r\n var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),\r\n len = binStr.length,\r\n arr = new Uint8Array(len);\r\n\r\n for (var i=0; i<len; i++ ) {\r\n arr[i] = binStr.charCodeAt(i);\r\n }\r\n\r\n callback( new Blob( [arr], {type: type || 'image/png'} ) );\r\n }\r\n });\r\n }\r\n /* End Polyfills */\r\n\r\n var cssPrefixes = ['Webkit', 'Moz', 'ms'],\r\n emptyStyles = typeof document !== 'undefined' ? document.createElement('div').style : {},\r\n EXIF_NORM = [1,8,3,6],\r\n EXIF_FLIP = [2,7,4,5],\r\n CSS_TRANS_ORG,\r\n CSS_TRANSFORM,\r\n CSS_USERSELECT;\r\n\r\n function vendorPrefix(prop) {\r\n if (prop in emptyStyles) {\r\n return prop;\r\n }\r\n\r\n var capProp = prop[0].toUpperCase() + prop.slice(1),\r\n i = cssPrefixes.length;\r\n\r\n while (i--) {\r\n prop = cssPrefixes[i] + capProp;\r\n if (prop in emptyStyles) {\r\n return prop;\r\n }\r\n }\r\n }\r\n\r\n CSS_TRANSFORM = vendorPrefix('transform');\r\n CSS_TRANS_ORG = vendorPrefix('transformOrigin');\r\n CSS_USERSELECT = vendorPrefix('userSelect');\r\n\r\n function getExifOffset(ornt, rotate) {\r\n var arr = EXIF_NORM.indexOf(ornt) > -1 ? EXIF_NORM : EXIF_FLIP,\r\n index = arr.indexOf(ornt),\r\n offset = (rotate / 90) % arr.length;// 180 = 2%4 = 2 shift exif by 2 indexes\r\n\r\n return arr[(arr.length + index + (offset % arr.length)) % arr.length];\r\n }\r\n\r\n // Credits to : Andrew Dupont - http://andrewdupont.net/2009/08/28/deep-extending-objects-in-javascript/\r\n function deepExtend(destination, source) {\r\n destination = destination || {};\r\n for (var property in source) {\r\n if (source[property] && source[property].constructor && source[property].constructor === Object) {\r\n destination[property] = destination[property] || {};\r\n deepExtend(destination[property], source[property]);\r\n } else {\r\n destination[property] = source[property];\r\n }\r\n }\r\n return destination;\r\n }\r\n\r\n function clone(object) {\r\n return deepExtend({}, object);\r\n }\r\n\r\n function debounce(func, wait, immediate) {\r\n var timeout;\r\n return function () {\r\n var context = this, args = arguments;\r\n var later = function () {\r\n timeout = null;\r\n if (!immediate) func.apply(context, args);\r\n };\r\n var callNow = immediate && !timeout;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n if (callNow) func.apply(context, args);\r\n };\r\n }\r\n\r\n function dispatchChange(element) {\r\n if (\"createEvent\" in document) {\r\n var evt = document.createEvent(\"HTMLEvents\");\r\n evt.initEvent(\"change\", false, true);\r\n element.dispatchEvent(evt);\r\n }\r\n else {\r\n element.fireEvent(\"onchange\");\r\n }\r\n }\r\n\r\n //http://jsperf.com/vanilla-css\r\n function css(el, styles, val) {\r\n if (typeof (styles) === 'string') {\r\n var tmp = styles;\r\n styles = {};\r\n styles[tmp] = val;\r\n }\r\n\r\n for (var prop in styles) {\r\n el.style[prop] = styles[prop];\r\n }\r\n }\r\n\r\n function addClass(el, c) {\r\n if (el.classList) {\r\n el.classList.add(c);\r\n }\r\n else {\r\n el.className += ' ' + c;\r\n }\r\n }\r\n\r\n function removeClass(el, c) {\r\n if (el.classList) {\r\n el.classList.remove(c);\r\n }\r\n else {\r\n el.className = el.className.replace(c, '');\r\n }\r\n }\r\n\r\n function setAttributes(el, attrs) {\r\n for (var key in attrs) {\r\n el.setAttribute(key, attrs[key]);\r\n }\r\n }\r\n\r\n function num(v) {\r\n return parseInt(v, 10);\r\n }\r\n\r\n /* Utilities */\r\n function loadImage(src, doExif) {\r\n if (!src) { throw 'Source image missing'; }\r\n \r\n var img = new Image();\r\n img.style.opacity = '0';\r\n return new Promise(function (resolve, reject) {\r\n function _resolve() {\r\n img.style.opacity = '1';\r\n setTimeout(function () {\r\n resolve(img);\r\n }, 1);\r\n }\r\n\r\n img.removeAttribute('crossOrigin');\r\n if (src.match(/^https?:\\/\\/|^\\/\\//)) {\r\n img.setAttribute('crossOrigin', 'anonymous');\r\n }\r\n\r\n img.onload = function () {\r\n if (doExif) {\r\n EXIF.getData(img, function () {\r\n _resolve();\r\n });\r\n }\r\n else {\r\n _resolve();\r\n }\r\n };\r\n img.onerror = function (ev) {\r\n img.style.opacity = 1;\r\n setTimeout(function () {\r\n reject(ev);\r\n }, 1);\r\n };\r\n img.src = src;\r\n });\r\n }\r\n\r\n function naturalImageDimensions(img, ornt) {\r\n var w = img.naturalWidth;\r\n var h = img.naturalHeight;\r\n var orient = ornt || getExifOrientation(img);\r\n if (orient && orient >= 5) {\r\n var x= w;\r\n w = h;\r\n h = x;\r\n }\r\n return { width: w, height: h };\r\n }\r\n\r\n /* CSS Transform Prototype */\r\n var TRANSLATE_OPTS = {\r\n 'translate3d': {\r\n suffix: ', 0px'\r\n },\r\n 'translate': {\r\n suffix: ''\r\n }\r\n };\r\n var Transform = function (x, y, scale) {\r\n this.x = parseFloat(x);\r\n this.y = parseFloat(y);\r\n this.scale = parseFloat(scale);\r\n };\r\n\r\n Transform.parse = function (v) {\r\n if (v.style) {\r\n return Transform.parse(v.style[CSS_TRANSFORM]);\r\n }\r\n else if (v.indexOf('matrix') > -1 || v.indexOf('none') > -1) {\r\n return Transform.fromMatrix(v);\r\n }\r\n else {\r\n return Transform.fromString(v);\r\n }\r\n };\r\n\r\n Transform.fromMatrix = function (v) {\r\n var vals = v.substring(7).split(',');\r\n if (!vals.length || v === 'none') {\r\n vals = [1, 0, 0, 1, 0, 0];\r\n }\r\n\r\n return new Transform(num(vals[4]), num(vals[5]), parseFloat(vals[0]));\r\n };\r\n\r\n Transform.fromString = function (v) {\r\n var values = v.split(') '),\r\n translate = values[0].substring(Croppie.globals.translate.length + 1).split(','),\r\n scale = values.length > 1 ? values[1].substring(6) : 1,\r\n x = translate.length > 1 ? translate[0] : 0,\r\n y = translate.length > 1 ? translate[1] : 0;\r\n\r\n return new Transform(x, y, scale);\r\n };\r\n\r\n Transform.prototype.toString = function () {\r\n var suffix = TRANSLATE_OPTS[Croppie.globals.translate].suffix || '';\r\n return Croppie.globals.translate + '(' + this.x + 'px, ' + this.y + 'px' + suffix + ') scale(' + this.scale + ')';\r\n };\r\n\r\n var TransformOrigin = function (el) {\r\n if (!el || !el.style[CSS_TRANS_ORG]) {\r\n this.x = 0;\r\n this.y = 0;\r\n return;\r\n }\r\n var css = el.style[CSS_TRANS_ORG].split(' ');\r\n this.x = parseFloat(css[0]);\r\n this.y = parseFloat(css[1]);\r\n };\r\n\r\n TransformOrigin.prototype.toString = function () {\r\n return this.x + 'px ' + this.y + 'px';\r\n };\r\n\r\n function getExifOrientation (img) {\r\n return img.exifdata && img.exifdata.Orientation ? num(img.exifdata.Orientation) : 1;\r\n }\r\n\r\n function drawCanvas(canvas, img, orientation) {\r\n var width = img.width,\r\n height = img.height,\r\n ctx = canvas.getContext('2d');\r\n\r\n canvas.width = img.width;\r\n canvas.height = img.height;\r\n\r\n ctx.save();\r\n switch (orientation) {\r\n case 2:\r\n ctx.translate(width, 0);\r\n ctx.scale(-1, 1);\r\n break;\r\n\r\n case 3:\r\n ctx.translate(width, height);\r\n ctx.rotate(180*Math.PI/180);\r\n break;\r\n\r\n case 4:\r\n ctx.translate(0, height);\r\n ctx.scale(1, -1);\r\n break;\r\n\r\n case 5:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.rotate(90*Math.PI/180);\r\n ctx.scale(1, -1);\r\n break;\r\n\r\n case 6:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.rotate(90*Math.PI/180);\r\n ctx.translate(0, -height);\r\n break;\r\n\r\n case 7:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.rotate(-90*Math.PI/180);\r\n ctx.translate(-width, height);\r\n ctx.scale(1, -1);\r\n break;\r\n\r\n case 8:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.translate(0, width);\r\n ctx.rotate(-90*Math.PI/180);\r\n break;\r\n }\r\n ctx.drawImage(img, 0,0, width, height);\r\n ctx.restore();\r\n }\r\n\r\n /* Private Methods */\r\n function _create() {\r\n var self = this,\r\n contClass = 'croppie-container',\r\n customViewportClass = self.options.viewport.type ? 'cr-vp-' + self.options.viewport.type : null,\r\n boundary, img, viewport, overlay, bw, bh;\r\n\r\n self.options.useCanvas = self.options.enableOrientation || _hasExif.call(self);\r\n // Properties on class\r\n self.data = {};\r\n self.elements = {};\r\n\r\n boundary = self.elements.boundary = document.createElement('div');\r\n viewport = self.elements.viewport = document.createElement('div');\r\n img = self.elements.img = document.createElement('img');\r\n overlay = self.elements.overlay = document.createElement('div');\r\n\r\n if (self.options.useCanvas) {\r\n self.elements.canvas = document.createElement('canvas');\r\n self.elements.preview = self.elements.canvas;\r\n }\r\n else {\r\n self.elements.preview = img;\r\n }\r\n\r\n addClass(boundary, 'cr-boundary');\r\n boundary.setAttribute('aria-dropeffect', 'none');\r\n bw = self.options.boundary.width;\r\n bh = self.options.boundary.height;\r\n css(boundary, {\r\n width: (bw + (isNaN(bw) ? '' : 'px')),\r\n height: (bh + (isNaN(bh) ? '' : 'px'))\r\n });\r\n\r\n addClass(viewport, 'cr-viewport');\r\n if (customViewportClass) {\r\n addClass(viewport, customViewportClass);\r\n }\r\n css(viewport, {\r\n width: self.options.viewport.width + 'px',\r\n height: self.options.viewport.height + 'px'\r\n });\r\n viewport.setAttribute('tabindex', 0);\r\n\r\n addClass(self.elements.preview, 'cr-image');\r\n setAttributes(self.elements.preview, { 'alt': 'preview', 'aria-grabbed': 'false' });\r\n addClass(overlay, 'cr-overlay');\r\n\r\n self.element.appendChild(boundary);\r\n boundary.appendChild(self.elements.preview);\r\n boundary.appendChild(viewport);\r\n boundary.appendChild(overlay);\r\n\r\n addClass(self.element, contClass);\r\n if (self.options.customClass) {\r\n addClass(self.element, self.options.customClass);\r\n }\r\n\r\n _initDraggable.call(this);\r\n\r\n if (self.options.enableZoom) {\r\n _initializeZoom.call(self);\r\n }\r\n\r\n // if (self.options.enableOrientation) {\r\n // _initRotationControls.call(self);\r\n // }\r\n\r\n if (self.options.enableResize) {\r\n _initializeResize.call(self);\r\n }\r\n }\r\n\r\n // function _initRotationControls () {\r\n // var self = this,\r\n // wrap, btnLeft, btnRight, iLeft, iRight;\r\n\r\n // wrap = document.createElement('div');\r\n // self.elements.orientationBtnLeft = btnLeft = document.createElement('button');\r\n // self.elements.orientationBtnRight = btnRight = document.createElement('button');\r\n\r\n // wrap.appendChild(btnLeft);\r\n // wrap.appendChild(btnRight);\r\n\r\n // iLeft = document.createElement('i');\r\n // iRight = document.createElement('i');\r\n // btnLeft.appendChild(iLeft);\r\n // btnRight.appendChild(iRight);\r\n\r\n // addClass(wrap, 'cr-rotate-controls');\r\n // addClass(btnLeft, 'cr-rotate-l');\r\n // addClass(btnRight, 'cr-rotate-r');\r\n\r\n // self.elements.boundary.appendChild(wrap);\r\n\r\n // btnLeft.addEventListener('click', function () {\r\n // self.rotate(-90);\r\n // });\r\n // btnRight.addEventListener('click', function () {\r\n // self.rotate(90);\r\n // });\r\n // }\r\n\r\n function _hasExif() {\r\n return this.options.enableExif && window.EXIF;\r\n }\r\n\r\n function _initializeResize () {\r\n var self = this;\r\n var wrap = document.createElement('div');\r\n var isDragging = false;\r\n var direction;\r\n var originalX;\r\n var originalY;\r\n var minSize = 50;\r\n var maxWidth;\r\n var maxHeight;\r\n var vr;\r\n var hr;\r\n\r\n addClass(wrap, 'cr-resizer');\r\n css(wrap, {\r\n width: this.options.viewport.width + 'px',\r\n height: this.options.viewport.height + 'px'\r\n });\r\n\r\n if (this.options.resizeControls.height) {\r\n vr = document.createElement('div');\r\n addClass(vr, 'cr-resizer-vertical');\r\n wrap.appendChild(vr);\r\n }\r\n\r\n if (this.options.resizeControls.width) {\r\n hr = document.createElement('div');\r\n addClass(hr, 'cr-resizer-horisontal');\r\n wrap.appendChild(hr);\r\n }\r\n\r\n function mouseDown(ev) {\r\n if (ev.button !== undefined && ev.button !== 0) return;\r\n\r\n ev.preventDefault();\r\n if (isDragging) {\r\n return;\r\n }\r\n\r\n var overlayRect = self.elements.overlay.getBoundingClientRect();\r\n\r\n isDragging = true;\r\n originalX = ev.pageX;\r\n originalY = ev.pageY;\r\n direction = ev.currentTarget.className.indexOf('vertical') !== -1 ? 'v' : 'h';\r\n maxWidth = overlayRect.width;\r\n maxHeight = overlayRect.height;\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n originalX = touches.pageX;\r\n originalY = touches.pageY;\r\n }\r\n\r\n window.addEventListener('mousemove', mouseMove);\r\n window.addEventListener('touchmove', mouseMove);\r\n window.addEventListener('mouseup', mouseUp);\r\n window.addEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = 'none';\r\n }\r\n\r\n function mouseMove(ev) {\r\n var pageX = ev.pageX;\r\n var pageY = ev.pageY;\r\n\r\n ev.preventDefault();\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n pageX = touches.pageX;\r\n pageY = touches.pageY;\r\n }\r\n\r\n var deltaX = pageX - originalX;\r\n var deltaY = pageY - originalY;\r\n var newHeight = self.options.viewport.height + deltaY;\r\n var newWidth = self.options.viewport.width + deltaX;\r\n\r\n if (direction === 'v' && newHeight >= minSize && newHeight <= maxHeight) {\r\n css(wrap, {\r\n height: newHeight + 'px'\r\n });\r\n\r\n self.options.boundary.height += deltaY;\r\n css(self.elements.boundary, {\r\n height: self.options.boundary.height + 'px'\r\n });\r\n\r\n self.options.viewport.height += deltaY;\r\n css(self.elements.viewport, {\r\n height: self.options.viewport.height + 'px'\r\n });\r\n }\r\n else if (direction === 'h' && newWidth >= minSize && newWidth <= maxWidth) {\r\n css(wrap, {\r\n width: newWidth + 'px'\r\n });\r\n\r\n self.options.boundary.width += deltaX;\r\n css(self.elements.boundary, {\r\n width: self.options.boundary.width + 'px'\r\n });\r\n\r\n self.options.viewport.width += deltaX;\r\n css(self.elements.viewport, {\r\n width: self.options.viewport.width + 'px'\r\n });\r\n }\r\n\r\n _updateOverlay.call(self);\r\n _updateZoomLimits.call(self);\r\n _updateCenterPoint.call(self);\r\n _triggerUpdate.call(self);\r\n originalY = pageY;\r\n originalX = pageX;\r\n }\r\n\r\n function mouseUp() {\r\n isDragging = false;\r\n window.removeEventListener('mousemove', mouseMove);\r\n window.removeEventListener('touchmove', mouseMove);\r\n window.removeEventListener('mouseup', mouseUp);\r\n window.removeEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = '';\r\n }\r\n\r\n if (vr) {\r\n vr.addEventListener('mousedown', mouseDown);\r\n vr.addEventListener('touchstart', mouseDown);\r\n }\r\n\r\n if (hr) {\r\n hr.addEventListener('mousedown', mouseDown);\r\n hr.addEventListener('touchstart', mouseDown);\r\n }\r\n\r\n this.elements.boundary.appendChild(wrap);\r\n }\r\n\r\n function _setZoomerVal(v) {\r\n if (this.options.enableZoom) {\r\n var z = this.elements.zoomer,\r\n val = fix(v, 4);\r\n\r\n z.value = Math.max(parseFloat(z.min), Math.min(parseFloat(z.max), val)).toString();\r\n }\r\n }\r\n\r\n function _initializeZoom() {\r\n var self = this,\r\n wrap = self.elements.zoomerWrap = document.createElement('div'),\r\n zoomer = self.elements.zoomer = document.createElement('input');\r\n\r\n addClass(wrap, 'cr-slider-wrap');\r\n addClass(zoomer, 'cr-slider');\r\n zoomer.type = 'range';\r\n zoomer.step = '0.0001';\r\n zoomer.value = '1';\r\n zoomer.style.display = self.options.showZoomer ? '' : 'none';\r\n zoomer.setAttribute('aria-label', 'zoom');\r\n\r\n self.element.appendChild(wrap);\r\n wrap.appendChild(zoomer);\r\n\r\n self._currentZoom = 1;\r\n\r\n function change() {\r\n _onZoom.call(self, {\r\n value: parseFloat(zoomer.value),\r\n origin: new TransformOrigin(self.elements.preview),\r\n viewportRect: self.elements.viewport.getBoundingClientRect(),\r\n transform: Transform.parse(self.elements.preview)\r\n });\r\n }\r\n\r\n function scroll(ev) {\r\n var delta, targetZoom;\r\n\r\n if(self.options.mouseWheelZoom === 'ctrl' && ev.ctrlKey !== true){\r\n return 0;\r\n } else if (ev.wheelDelta) {\r\n delta = ev.wheelDelta / 1200; //wheelDelta min: -120 max: 120 // max x 10 x 2\r\n } else if (ev.deltaY) {\r\n delta = ev.deltaY / 1060; //deltaY min: -53 max: 53 // max x 10 x 2\r\n } else if (ev.detail) {\r\n delta = ev.detail / -60; //delta min: -3 max: 3 // max x 10 x 2\r\n } else {\r\n delta = 0;\r\n }\r\n\r\n targetZoom = self._currentZoom + (delta * self._currentZoom);\r\n\r\n ev.preventDefault();\r\n _setZoomerVal.call(self, targetZoom);\r\n change.call(self);\r\n }\r\n\r\n self.elements.zoomer.addEventListener('input', change);// this is being fired twice on keypress\r\n self.elements.zoomer.addEventListener('change', change);\r\n\r\n if (self.options.mouseWheelZoom) {\r\n self.elements.boundary.addEventListener('mousewheel', scroll);\r\n self.elements.boundary.addEventListener('DOMMouseScroll', scroll);\r\n }\r\n }\r\n\r\n function _onZoom(ui) {\r\n var self = this,\r\n transform = ui ? ui.transform : Transform.parse(self.elements.preview),\r\n vpRect = ui ? ui.viewportRect : self.elements.viewport.getBoundingClientRect(),\r\n origin = ui ? ui.origin : new TransformOrigin(self.elements.preview);\r\n\r\n function applyCss() {\r\n var transCss = {};\r\n transCss[CSS_TRANSFORM] = transform.toString();\r\n transCss[CSS_TRANS_ORG] = origin.toString();\r\n css(self.elements.preview, transCss);\r\n }\r\n\r\n self._currentZoom = ui ? ui.value : self._currentZoom;\r\n transform.scale = self._currentZoom;\r\n self.elements.zoomer.setAttribute('aria-valuenow', self._currentZoom);\r\n applyCss();\r\n\r\n if (self.options.enforceBoundary) {\r\n var boundaries = _getVirtualBoundaries.call(self, vpRect),\r\n transBoundaries = boundaries.translate,\r\n oBoundaries = boundaries.origin;\r\n\r\n if (transform.x >= transBoundaries.maxX) {\r\n origin.x = oBoundaries.minX;\r\n transform.x = transBoundaries.maxX;\r\n }\r\n\r\n if (transform.x <= transBoundaries.minX) {\r\n origin.x = oBoundaries.maxX;\r\n transform.x = transBoundaries.minX;\r\n }\r\n\r\n if (transform.y >= transBoundaries.maxY) {\r\n origin.y = oBoundaries.minY;\r\n transform.y = transBoundaries.maxY;\r\n }\r\n\r\n if (transform.y <= transBoundaries.minY) {\r\n origin.y = oBoundaries.maxY;\r\n transform.y = transBoundaries.minY;\r\n }\r\n }\r\n applyCss();\r\n _debouncedOverlay.call(self);\r\n _triggerUpdate.call(self);\r\n }\r\n\r\n function _getVirtualBoundaries(viewport) {\r\n var self = this,\r\n scale = self._currentZoom,\r\n vpWidth = viewport.width,\r\n vpHeight = viewport.height,\r\n centerFromBoundaryX = self.elements.boundary.clientWidth / 2,\r\n centerFromBoundaryY = self.elements.boundary.clientHeight / 2,\r\n imgRect = self.elements.preview.getBoundingClientRect(),\r\n curImgWidth = imgRect.width,\r\n curImgHeight = imgRect.height,\r\n halfWidth = vpWidth / 2,\r\n halfHeight = vpHeight / 2;\r\n\r\n var maxX = ((halfWidth / scale) - centerFromBoundaryX) * -1;\r\n var minX = maxX - ((curImgWidth * (1 / scale)) - (vpWidth * (1 / scale)));\r\n\r\n var maxY = ((halfHeight / scale) - centerFromBoundaryY) * -1;\r\n var minY = maxY - ((curImgHeight * (1 / scale)) - (vpHeight * (1 / scale)));\r\n\r\n var originMinX = (1 / scale) * halfWidth;\r\n var originMaxX = (curImgWidth * (1 / scale)) - originMinX;\r\n\r\n var originMinY = (1 / scale) * halfHeight;\r\n var originMaxY = (curImgHeight * (1 / scale)) - originMinY;\r\n\r\n return {\r\n translate: {\r\n maxX: maxX,\r\n minX: minX,\r\n maxY: maxY,\r\n minY: minY\r\n },\r\n origin: {\r\n maxX: originMaxX,\r\n minX: originMinX,\r\n maxY: originMaxY,\r\n minY: originMinY\r\n }\r\n };\r\n }\r\n\r\n function _updateCenterPoint(rotate) {\r\n var self = this,\r\n scale = self._currentZoom,\r\n data = self.elements.preview.getBoundingClientRect(),\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n transform = Transform.parse(self.elements.preview.style[CSS_TRANSFORM]),\r\n pc = new TransformOrigin(self.elements.preview),\r\n top = (vpData.top - data.top) + (vpData.height / 2),\r\n left = (vpData.left - data.left) + (vpData.width / 2),\r\n center = {},\r\n adj = {};\r\n\r\n if (rotate) {\r\n var cx = pc.x;\r\n var cy = pc.y;\r\n var tx = transform.x;\r\n var ty = transform.y;\r\n\r\n center.y = cx;\r\n center.x = cy;\r\n transform.y = tx;\r\n transform.x = ty;\r\n }\r\n else {\r\n center.y = top / scale;\r\n center.x = left / scale;\r\n\r\n adj.y = (center.y - pc.y) * (1 - scale);\r\n adj.x = (center.x - pc.x) * (1 - scale);\r\n\r\n transform.x -= adj.x;\r\n transform.y -= adj.y;\r\n }\r\n\r\n var newCss = {};\r\n newCss[CSS_TRANS_ORG] = center.x + 'px ' + center.y + 'px';\r\n newCss[CSS_TRANSFORM] = transform.toString();\r\n css(self.elements.preview, newCss);\r\n }\r\n\r\n function _initDraggable() {\r\n var self = this,\r\n isDragging = false,\r\n originalX,\r\n originalY,\r\n originalDistance,\r\n vpRect,\r\n transform;\r\n\r\n function assignTransformCoordinates(deltaX, deltaY) {\r\n var imgRect = self.elements.preview.getBoundingClientRect(),\r\n top = transform.y + deltaY,\r\n left = transform.x + deltaX;\r\n\r\n if (self.options.enforceBoundary) {\r\n if (vpRect.top > imgRect.top + deltaY && vpRect.bottom < imgRect.bottom + deltaY) {\r\n transform.y = top;\r\n }\r\n\r\n if (vpRect.left > imgRect.left + deltaX && vpRect.right < imgRect.right + deltaX) {\r\n transform.x = left;\r\n }\r\n }\r\n else {\r\n transform.y = top;\r\n transform.x = left;\r\n }\r\n }\r\n\r\n function toggleGrabState(isDragging) {\r\n self.elements.preview.setAttribute('aria-grabbed', isDragging);\r\n self.elements.boundary.setAttribute('aria-dropeffect', isDragging? 'move': 'none');\r\n }\r\n\r\n function keyDown(ev) {\r\n var LEFT_ARROW = 37,\r\n UP_ARROW = 38,\r\n RIGHT_ARROW = 39,\r\n DOWN_ARROW = 40;\r\n\r\n if (ev.shiftKey && (ev.keyCode === UP_ARROW || ev.keyCode === DOWN_ARROW)) {\r\n var zoom;\r\n if (ev.keyCode === UP_ARROW) {\r\n zoom = parseFloat(self.elements.zoomer.value) + parseFloat(self.elements.zoomer.step)\r\n }\r\n else {\r\n zoom = parseFloat(self.elements.zoomer.value) - parseFloat(self.elements.zoomer.step)\r\n }\r\n self.setZoom(zoom);\r\n }\r\n else if (self.options.enableKeyMovement && (ev.keyCode >= 37 && ev.keyCode <= 40)) {\r\n ev.preventDefault();\r\n var movement = parseKeyDown(ev.keyCode);\r\n\r\n transform = Transform.parse(self.elements.preview);\r\n document.body.style[CSS_USERSELECT] = 'none';\r\n vpRect = self.elements.viewport.getBoundingClientRect();\r\n keyMove(movement);\r\n }\r\n\r\n function parseKeyDown(key) {\r\n switch (key) {\r\n case LEFT_ARROW:\r\n return [1, 0];\r\n case UP_ARROW:\r\n return [0, 1];\r\n case RIGHT_ARROW:\r\n return [-1, 0];\r\n case DOWN_ARROW:\r\n return [0, -1];\r\n }\r\n }\r\n }\r\n\r\n function keyMove(movement) {\r\n var deltaX = movement[0],\r\n deltaY = movement[1],\r\n newCss = {};\r\n\r\n assignTransformCoordinates(deltaX, deltaY);\r\n\r\n newCss[CSS_TRANSFORM] = transform.toString();\r\n css(self.elements.preview, newCss);\r\n _updateOverlay.call(self);\r\n document.body.style[CSS_USERSELECT] = '';\r\n _updateCenterPoint.call(self);\r\n _triggerUpdate.call(self);\r\n originalDistance = 0;\r\n }\r\n\r\n function mouseDown(ev) {\r\n if (ev.button !== undefined && ev.button !== 0) return;\r\n\r\n ev.preventDefault();\r\n if (isDragging) return;\r\n isDragging = true;\r\n originalX = ev.pageX;\r\n originalY = ev.pageY;\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n originalX = touches.pageX;\r\n originalY = touches.pageY;\r\n }\r\n toggleGrabState(isDragging);\r\n transform = Transform.parse(self.elements.preview);\r\n window.addEventListener('mousemove', mouseMove);\r\n window.addEventListener('touchmove', mouseMove);\r\n window.addEventListener('mouseup', mouseUp);\r\n window.addEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = 'none';\r\n vpRect = self.elements.viewport.getBoundingClientRect();\r\n }\r\n\r\n function mouseMove(ev) {\r\n ev.preventDefault();\r\n var pageX = ev.pageX,\r\n pageY = ev.pageY;\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n pageX = touches.pageX;\r\n pageY = touches.pageY;\r\n }\r\n\r\n var deltaX = pageX - originalX,\r\n deltaY = pageY - originalY,\r\n newCss = {};\r\n\r\n if (ev.type === 'touchmove') {\r\n if (ev.touches.length > 1) {\r\n var touch1 = ev.touches[0];\r\n var touch2 = ev.touches[1];\r\n var dist = Math.sqrt((touch1.pageX - touch2.pageX) * (touch1.pageX - touch2.pageX) + (touch1.pageY - touch2.pageY) * (touch1.pageY - touch2.pageY));\r\n\r\n if (!originalDistance) {\r\n originalDistance = dist / self._currentZoom;\r\n }\r\n\r\n var scale = dist / originalDistance;\r\n\r\n _setZoomerVal.call(self, scale);\r\n dispatchChange(self.elements.zoomer);\r\n return;\r\n }\r\n }\r\n\r\n assignTransformCoordinates(deltaX, deltaY);\r\n\r\n newCss[CSS_TRANSFORM] = transform.toString();\r\n css(self.elements.preview, newCss);\r\n _updateOverlay.call(self);\r\n originalY = pageY;\r\n originalX = pageX;\r\n }\r\n\r\n function mouseUp() {\r\n isDragging = false;\r\n toggleGrabState(isDragging);\r\n window.removeEventListener('mousemove', mouseMove);\r\n window.removeEventListener('touchmove', mouseMove);\r\n window.removeEventListener('mouseup', mouseUp);\r\n window.removeEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = '';\r\n _updateCenterPoint.call(self);\r\n _triggerUpdate.call(self);\r\n originalDistance = 0;\r\n }\r\n\r\n self.elements.overlay.addEventListener('mousedown', mouseDown);\r\n self.elements.viewport.addEventListener('keydown', keyDown);\r\n self.elements.overlay.addEventListener('touchstart', mouseDown);\r\n }\r\n\r\n function _updateOverlay() {\r\n if (!this.elements) return; // since this is debounced, it can be fired after destroy\r\n var self = this,\r\n boundRect = self.elements.boundary.getBoundingClientRect(),\r\n imgData = self.elements.preview.getBoundingClientRect();\r\n\r\n css(self.elements.overlay, {\r\n width: imgData.width + 'px',\r\n height: imgData.height + 'px',\r\n top: (imgData.top - boundRect.top) + 'px',\r\n left: (imgData.left - boundRect.left) + 'px'\r\n });\r\n }\r\n var _debouncedOverlay = debounce(_updateOverlay, 500);\r\n\r\n function _triggerUpdate() {\r\n var self = this,\r\n data = self.get();\r\n\r\n if (!_isVisible.call(self)) {\r\n return;\r\n }\r\n\r\n self.options.update.call(self, data);\r\n if (self.$ && typeof Prototype === 'undefined') {\r\n self.$(self.element).trigger('update.croppie', data);\r\n }\r\n else {\r\n var ev;\r\n if (window.CustomEvent) {\r\n ev = new CustomEvent('update', { detail: data });\r\n } else {\r\n ev = document.createEvent('CustomEvent');\r\n ev.initCustomEvent('update', true, true, data);\r\n }\r\n\r\n self.element.dispatchEvent(ev);\r\n }\r\n }\r\n\r\n function _isVisible() {\r\n return this.elements.preview.offsetHeight > 0 && this.elements.preview.offsetWidth > 0;\r\n }\r\n\r\n function _updatePropertiesFromImage() {\r\n var self = this,\r\n initialZoom = 1,\r\n cssReset = {},\r\n img = self.elements.preview,\r\n imgData,\r\n transformReset = new Transform(0, 0, initialZoom),\r\n originReset = new TransformOrigin(),\r\n isVisible = _isVisible.call(self);\r\n\r\n if (!isVisible || self.data.bound) {// if the croppie isn't visible or it doesn't need binding\r\n return;\r\n }\r\n\r\n self.data.bound = true;\r\n cssReset[CSS_TRANSFORM] = transformReset.toString();\r\n cssReset[CSS_TRANS_ORG] = originReset.toString();\r\n cssReset['opacity'] = 1;\r\n css(img, cssReset);\r\n\r\n imgData = self.elements.preview.getBoundingClientRect();\r\n\r\n self._originalImageWidth = imgData.width;\r\n self._originalImageHeight = imgData.height;\r\n self.data.orientation = _hasExif.call(self) ? getExifOrientation(self.elements.img) : self.data.orientation;\r\n\r\n if (self.options.enableZoom) {\r\n _updateZoomLimits.call(self, true);\r\n }\r\n else {\r\n self._currentZoom = initialZoom;\r\n }\r\n\r\n transformReset.scale = self._currentZoom;\r\n cssReset[CSS_TRANSFORM] = transformReset.toString();\r\n css(img, cssReset);\r\n\r\n if (self.data.points.length) {\r\n _bindPoints.call(self, self.data.points);\r\n }\r\n else {\r\n _centerImage.call(self);\r\n }\r\n\r\n _updateCenterPoint.call(self);\r\n _updateOverlay.call(self);\r\n }\r\n\r\n function _updateZoomLimits (initial) {\r\n var self = this,\r\n minZoom = Math.max(self.options.minZoom, 0) || 0,\r\n maxZoom = self.options.maxZoom || 1.5,\r\n initialZoom,\r\n defaultInitialZoom,\r\n zoomer = self.elements.zoomer,\r\n scale = parseFloat(zoomer.value),\r\n boundaryData = self.elements.boundary.getBoundingClientRect(),\r\n imgData = naturalImageDimensions(self.elements.img, self.data.orientation),\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n minW,\r\n minH;\r\n if (self.options.enforceBoundary) {\r\n minW = vpData.width / imgData.width;\r\n minH = vpData.height / imgData.height;\r\n minZoom = Math.max(minW, minH);\r\n }\r\n\r\n if (minZoom >= maxZoom) {\r\n maxZoom = minZoom + 1;\r\n }\r\n\r\n zoomer.min = fix(minZoom, 4);\r\n zoomer.max = fix(maxZoom, 4);\r\n\r\n if (!initial && (scale < zoomer.min || scale > zoomer.max)) {\r\n _setZoomerVal.call(self, scale < zoomer.min ? zoomer.min : zoomer.max);\r\n }\r\n else if (initial) {\r\n defaultInitialZoom = Math.max((boundaryData.width / imgData.width), (boundaryData.height / imgData.height));\r\n initialZoom = self.data.boundZoom !== null ? self.data.boundZoom : defaultInitialZoom;\r\n _setZoomerVal.call(self, initialZoom);\r\n }\r\n\r\n dispatchChange(zoomer);\r\n }\r\n\r\n function _bindPoints(points) {\r\n if (points.length !== 4) {\r\n throw \"Croppie - Invalid number of points supplied: \" + points;\r\n }\r\n var self = this,\r\n pointsWidth = points[2] - points[0],\r\n // pointsHeight = points[3] - points[1],\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n boundRect = self.elements.boundary.getBoundingClientRect(),\r\n vpOffset = {\r\n left: vpData.left - boundRect.left,\r\n top: vpData.top - boundRect.top\r\n },\r\n scale = vpData.width / pointsWidth,\r\n originTop = points[1],\r\n originLeft = points[0],\r\n transformTop = (-1 * points[1]) + vpOffset.top,\r\n transformLeft = (-1 * points[0]) + vpOffset.left,\r\n newCss = {};\r\n\r\n newCss[CSS_TRANS_ORG] = originLeft + 'px ' + originTop + 'px';\r\n newCss[CSS_TRANSFORM] = new Transform(transformLeft, transformTop, scale).toString();\r\n css(self.elements.preview, newCss);\r\n\r\n _setZoomerVal.call(self, scale);\r\n self._currentZoom = scale;\r\n }\r\n\r\n function _centerImage() {\r\n var self = this,\r\n imgDim = self.elements.preview.getBoundingClientRect(),\r\n vpDim = self.elements.viewport.getBoundingClientRect(),\r\n boundDim = self.elements.boundary.getBoundingClientRect(),\r\n vpLeft = vpDim.left - boundDim.left,\r\n vpTop = vpDim.top - boundDim.top,\r\n w = vpLeft - ((imgDim.width - vpDim.width) / 2),\r\n h = vpTop - ((imgDim.height - vpDim.height) / 2),\r\n transform = new Transform(w, h, self._currentZoom);\r\n\r\n css(self.elements.preview, CSS_TRANSFORM, transform.toString());\r\n }\r\n\r\n function _transferImageToCanvas(customOrientation) {\r\n var self = this,\r\n canvas = self.elements.canvas,\r\n img = self.elements.img,\r\n ctx = canvas.getContext('2d');\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n canvas.width = img.width;\r\n canvas.height = img.height;\r\n\r\n var orientation = self.options.enableOrientation && customOrientation || getExifOrientation(img);\r\n drawCanvas(canvas, img, orientation);\r\n }\r\n\r\n function _getCanvas(data) {\r\n var self = this,\r\n points = data.points,\r\n left = num(points[0]),\r\n top = num(points[1]),\r\n right = num(points[2]),\r\n bottom = num(points[3]),\r\n width = right-left,\r\n height = bottom-top,\r\n circle = data.circle,\r\n canvas = document.createElement('canvas'),\r\n ctx = canvas.getContext('2d'),\r\n startX = 0,\r\n startY = 0,\r\n canvasWidth = data.outputWidth || width,\r\n canvasHeight = data.outputHeight || height;\r\n\r\n canvas.width = canvasWidth;\r\n canvas.height = canvasHeight;\r\n\r\n if (data.backgroundColor) {\r\n ctx.fillStyle = data.backgroundColor;\r\n ctx.fillRect(0, 0, canvasWidth, canvasHeight);\r\n }\r\n\r\n // By default assume we're going to draw the entire\r\n // source image onto the destination canvas.\r\n var sx = left,\r\n sy = top,\r\n sWidth = width,\r\n sHeight = height,\r\n dx = 0,\r\n dy = 0,\r\n dWidth = canvasWidth,\r\n dHeight = canvasHeight;\r\n\r\n //\r\n // Do not go outside of the original image's bounds along the x-axis.\r\n // Handle translations when projecting onto the destination canvas.\r\n //\r\n\r\n // The smallest possible source x-position is 0.\r\n if (left < 0) {\r\n sx = 0;\r\n dx = (Math.abs(left) / width) * canvasWidth;\r\n }\r\n\r\n // The largest possible source width is the original image's width.\r\n if (sWidth + sx > self._originalImageWidth) {\r\n sWidth = self._originalImageWidth - sx;\r\n dWidth = (sWidth / width) * canvasWidth;\r\n }\r\n\r\n //\r\n // Do not go outside of the original image's bounds along the y-axis.\r\n //\r\n\r\n // The smallest possible source y-position is 0.\r\n if (top < 0) {\r\n sy = 0;\r\n dy = (Math.abs(top) / height) * canvasHeight;\r\n }\r\n\r\n // The largest possible source height is the original image's height.\r\n if (sHeight + sy > self._originalImageHeight) {\r\n sHeight = self._originalImageHeight - sy;\r\n dHeight = (sHeight / height) * canvasHeight;\r\n }\r\n\r\n // console.table({ left, right, top, bottom, canvasWidth, canvasHeight, width, height, startX, startY, circle, sx, sy, dx, dy, sWidth, sHeight, dWidth, dHeight });\r\n\r\n ctx.drawImage(this.elements.preview, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);\r\n if (circle) {\r\n ctx.fillStyle = '#fff';\r\n ctx.globalCompositeOperation = 'destination-in';\r\n ctx.beginPath();\r\n ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n }\r\n return canvas;\r\n }\r\n\r\n function _getHtmlResult(data) {\r\n var points = data.points,\r\n div = document.createElement('div'),\r\n img = document.createElement('img'),\r\n width = points[2] - points[0],\r\n height = points[3] - points[1];\r\n\r\n addClass(div, 'croppie-result');\r\n div.appendChild(img);\r\n css(img, {\r\n left: (-1 * points[0]) + 'px',\r\n top: (-1 * points[1]) + 'px'\r\n });\r\n img.src = data.url;\r\n css(div, {\r\n width: width + 'px',\r\n height: height + 'px'\r\n });\r\n\r\n return div;\r\n }\r\n\r\n function _getBase64Result(data) {\r\n return _getCanvas.call(this, data).toDataURL(data.format, data.quality);\r\n }\r\n\r\n function _getBlobResult(data) {\r\n var self = this;\r\n return new Promise(function (resolve) {\r\n _getCanvas.call(self, data).toBlob(function (blob) {\r\n resolve(blob);\r\n }, data.format, data.quality);\r\n });\r\n }\r\n\r\n function _replaceImage(img) {\r\n if (this.elements.img.parentNode) {\r\n Array.prototype.forEach.call(this.elements.img.classList, function(c) { img.classList.add(c); });\r\n this.elements.img.parentNode.replaceChild(img, this.elements.img);\r\n this.elements.preview = img; // if the img is attached to the DOM, they're not using the canvas\r\n }\r\n this.elements.img = img;\r\n }\r\n\r\n function _bind(options, cb) {\r\n var self = this,\r\n url,\r\n points = [],\r\n zoom = null,\r\n hasExif = _hasExif.call(self);\r\n\r\n if (typeof (options) === 'string') {\r\n url = options;\r\n options = {};\r\n }\r\n else if (Array.isArray(options)) {\r\n points = options.slice();\r\n }\r\n else if (typeof (options) === 'undefined' && self.data.url) { //refreshing\r\n _updatePropertiesFromImage.call(self);\r\n _triggerUpdate.call(self);\r\n return null;\r\n }\r\n else {\r\n url = options.url;\r\n points = options.points || [];\r\n zoom = typeof(options.zoom) === 'undefined' ? null : options.zoom;\r\n }\r\n\r\n self.data.bound = false;\r\n self.data.url = url || self.data.url;\r\n self.data.boundZoom = zoom;\r\n\r\n return loadImage(url, hasExif).then(function (img) {\r\n _replaceImage.call(self, img);\r\n if (!points.length) {\r\n var natDim = naturalImageDimensions(img);\r\n var rect = self.elements.viewport.getBoundingClientRect();\r\n var aspectRatio = rect.width / rect.height;\r\n var imgAspectRatio = natDim.width / natDim.height;\r\n var width, height;\r\n\r\n if (imgAspectRatio > aspectRatio) {\r\n height = natDim.height;\r\n width = height * aspectRatio;\r\n }\r\n else {\r\n width = natDim.width;\r\n height = natDim.height / aspectRatio;\r\n }\r\n\r\n var x0 = (natDim.width - width) / 2;\r\n var y0 = (natDim.height - height) / 2;\r\n var x1 = x0 + width;\r\n var y1 = y0 + height;\r\n self.data.points = [x0, y0, x1, y1];\r\n }\r\n else if (self.options.relative) {\r\n points = [\r\n points[0] * img.naturalWidth / 100,\r\n points[1] * img.naturalHeight / 100,\r\n points[2] * img.naturalWidth / 100,\r\n points[3] * img.naturalHeight / 100\r\n ];\r\n }\r\n\r\n self.data.orientation = options.orientation || 1;\r\n self.data.points = points.map(function (p) {\r\n return parseFloat(p);\r\n });\r\n if (self.options.useCanvas) {\r\n _transferImageToCanvas.call(self, self.data.orientation);\r\n }\r\n _updatePropertiesFromImage.call(self);\r\n _triggerUpdate.call(self);\r\n cb && cb();\r\n });\r\n }\r\n\r\n function fix(v, decimalPoints) {\r\n return parseFloat(v).toFixed(decimalPoints || 0);\r\n }\r\n\r\n function _get() {\r\n var self = this,\r\n imgData = self.elements.preview.getBoundingClientRect(),\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n x1 = vpData.left - imgData.left,\r\n y1 = vpData.top - imgData.top,\r\n widthDiff = (vpData.width - self.elements.viewport.offsetWidth) / 2, //border\r\n heightDiff = (vpData.height - self.elements.viewport.offsetHeight) / 2,\r\n x2 = x1 + self.elements.viewport.offsetWidth + widthDiff,\r\n y2 = y1 + self.elements.viewport.offsetHeight + heightDiff,\r\n scale = self._currentZoom;\r\n\r\n if (scale === Infinity || isNaN(scale)) {\r\n scale = 1;\r\n }\r\n\r\n var max = self.options.enforceBoundary ? 0 : Number.NEGATIVE_INFINITY;\r\n x1 = Math.max(max, x1 / scale);\r\n y1 = Math.max(max, y1 / scale);\r\n x2 = Math.max(max, x2 / scale);\r\n y2 = Math.max(max, y2 / scale);\r\n\r\n return {\r\n points: [fix(x1), fix(y1), fix(x2), fix(y2)],\r\n zoom: scale,\r\n orientation: self.data.orientation\r\n };\r\n }\r\n\r\n var RESULT_DEFAULTS = {\r\n type: 'canvas',\r\n format: 'png',\r\n quality: 1\r\n },\r\n RESULT_FORMATS = ['jpeg', 'webp', 'png'];\r\n\r\n function _result(options) {\r\n var self = this,\r\n data = _get.call(self),\r\n opts = deepExtend(clone(RESULT_DEFAULTS), clone(options)),\r\n resultType = (typeof (options) === 'string' ? options : (opts.type || 'base64')),\r\n size = opts.size || 'viewport',\r\n format = opts.format,\r\n quality = opts.quality,\r\n backgroundColor = opts.backgroundColor,\r\n circle = typeof opts.circle === 'boolean' ? opts.circle : (self.options.viewport.type === 'circle'),\r\n vpRect = self.elements.viewport.getBoundingClientRect(),\r\n ratio = vpRect.width / vpRect.height,\r\n prom;\r\n\r\n if (size === 'viewport') {\r\n data.outputWidth = vpRect.width;\r\n data.outputHeight = vpRect.height;\r\n } else if (typeof size === 'object') {\r\n if (size.width && size.height) {\r\n data.outputWidth = size.width;\r\n data.outputHeight = size.height;\r\n } else if (size.width) {\r\n data.outputWidth = size.width;\r\n data.outputHeight = size.width / ratio;\r\n } else if (size.height) {\r\n data.outputWidth = size.height * ratio;\r\n data.outputHeight = size.height;\r\n }\r\n }\r\n\r\n if (RESULT_FORMATS.indexOf(format) > -1) {\r\n data.format = 'image/' + format;\r\n data.quality = quality;\r\n }\r\n\r\n data.circle = circle;\r\n data.url = self.data.url;\r\n data.backgroundColor = backgroundColor;\r\n\r\n prom = new Promise(function (resolve) {\r\n switch(resultType.toLowerCase())\r\n {\r\n case 'rawcanvas':\r\n resolve(_getCanvas.call(self, data));\r\n break;\r\n case 'canvas':\r\n case 'base64':\r\n resolve(_getBase64Result.call(self, data));\r\n break;\r\n case 'blob':\r\n _getBlobResult.call(self, data).then(resolve);\r\n break;\r\n default:\r\n resolve(_getHtmlResult.call(self, data));\r\n break;\r\n }\r\n });\r\n return prom;\r\n }\r\n\r\n function _refresh() {\r\n _updatePropertiesFromImage.call(this);\r\n }\r\n\r\n function _rotate(deg) {\r\n if (!this.options.useCanvas || !this.options.enableOrientation) {\r\n throw 'Croppie: Cannot rotate without enableOrientation && EXIF.js included';\r\n }\r\n\r\n var self = this,\r\n canvas = self.elements.canvas;\r\n\r\n self.data.orientation = getExifOffset(self.data.orientation, deg);\r\n drawCanvas(canvas, self.elements.img, self.data.orientation);\r\n _updateCenterPoint.call(self, true);\r\n _updateZoomLimits.call(self);\r\n\r\n // Reverses image dimensions if the degrees of rotation is not divisible by 180.\r\n if ((Math.abs(deg) / 90) % 2 === 1) {\r\n var oldHeight = self._originalImageHeight;\r\n var oldWidth = self._originalImageWidth;\r\n self._originalImageWidth = oldHeight;\r\n self._originalImageHeight = oldWidth;\r\n }\r\n }\r\n\r\n function _destroy() {\r\n var self = this;\r\n self.element.removeChild(self.elements.boundary);\r\n removeClass(self.element, 'croppie-container');\r\n if (self.options.enableZoom) {\r\n self.element.removeChild(self.elements.zoomerWrap);\r\n }\r\n delete self.elements;\r\n }\r\n\r\n if (typeof window !== 'undefined' && window.jQuery) {\r\n var $ = window.jQuery;\r\n $.fn.croppie = function (opts) {\r\n var ot = typeof opts;\r\n\r\n if (ot === 'string') {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n var singleInst = $(this).data('croppie');\r\n\r\n if (opts === 'get') {\r\n return singleInst.get();\r\n }\r\n else if (opts === 'result') {\r\n return singleInst.result.apply(singleInst, args);\r\n }\r\n else if (opts === 'bind') {\r\n return singleInst.bind.apply(singleInst, args);\r\n }\r\n\r\n return this.each(function () {\r\n var i = $(this).data('croppie');\r\n if (!i) return;\r\n\r\n var method = i[opts];\r\n if ($.isFunction(method)) {\r\n method.apply(i, args);\r\n if (opts === 'destroy') {\r\n $(this).removeData('croppie');\r\n }\r\n }\r\n else {\r\n throw 'Croppie ' + opts + ' method not found';\r\n }\r\n });\r\n }\r\n else {\r\n return this.each(function () {\r\n var i = new Croppie(this, opts);\r\n i.$ = $;\r\n $(this).data('croppie', i);\r\n });\r\n }\r\n };\r\n }\r\n\r\n function Croppie(element, opts) {\r\n if (element.className.indexOf('croppie-container') > -1) {\r\n throw new Error(\"Croppie: Can't initialize croppie more than once\");\r\n }\r\n this.element = element;\r\n this.options = deepExtend(clone(Croppie.defaults), opts);\r\n\r\n if (this.element.tagName.toLowerCase() === 'img') {\r\n var origImage = this.element;\r\n addClass(origImage, 'cr-original-image');\r\n setAttributes(origImage, {'aria-hidden' : 'true', 'alt' : '' });\r\n var replacementDiv = document.createElement('div');\r\n this.element.parentNode.appendChild(replacementDiv);\r\n replacementDiv.appendChild(origImage);\r\n this.element = replacementDiv;\r\n this.options.url = this.options.url || origImage.src;\r\n }\r\n\r\n _create.call(this);\r\n if (this.options.url) {\r\n var bindOpts = {\r\n url: this.options.url,\r\n points: this.options.points\r\n };\r\n delete this.options['url'];\r\n delete this.options['points'];\r\n _bind.call(this, bindOpts);\r\n }\r\n }\r\n\r\n Croppie.defaults = {\r\n viewport: {\r\n width: 100,\r\n height: 100,\r\n type: 'square'\r\n },\r\n boundary: { },\r\n orientationControls: {\r\n enabled: true,\r\n leftClass: '',\r\n rightClass: ''\r\n },\r\n resizeControls: {\r\n width: true,\r\n height: true\r\n },\r\n customClass: '',\r\n showZoomer: true,\r\n enableZoom: true,\r\n enableResize: false,\r\n mouseWheelZoom: true,\r\n enableExif: false,\r\n enforceBoundary: true,\r\n enableOrientation: false,\r\n enableKeyMovement: true,\r\n update: function () { }\r\n };\r\n\r\n Croppie.globals = {\r\n translate: 'translate3d'\r\n };\r\n\r\n deepExtend(Croppie.prototype, {\r\n bind: function (options, cb) {\r\n return _bind.call(this, options, cb);\r\n },\r\n get: function () {\r\n var data = _get.call(this);\r\n var points = data.points;\r\n if (this.options.relative) {\r\n points[0] /= this.elements.img.naturalWidth / 100;\r\n points[1] /= this.elements.img.naturalHeight / 100;\r\n points[2] /= this.elements.img.naturalWidth / 100;\r\n points[3] /= this.elements.img.naturalHeight / 100;\r\n }\r\n return data;\r\n },\r\n result: function (type) {\r\n return _result.call(this, type);\r\n },\r\n refresh: function () {\r\n return _refresh.call(this);\r\n },\r\n setZoom: function (v) {\r\n _setZoomerVal.call(this, v);\r\n dispatchChange(this.elements.zoomer);\r\n },\r\n rotate: function (deg) {\r\n _rotate.call(this, deg);\r\n },\r\n destroy: function () {\r\n return _destroy.call(this);\r\n }\r\n });\r\n return Croppie;\r\n}));\r\n", "/*!\n * Compressor.js v1.2.1\n * https://fengyuanchen.github.io/compressorjs\n *\n * Copyright 2018-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2023-02-28T14:09:41.732Z\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Compressor = factory());\n})(this, (function () { 'use strict';\n\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n return keys;\n }\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n }\n function _defineProperty(obj, key, value) {\n key = _toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n }\n function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n }\n function _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n }\n function _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n }\n\n var canvasToBlob = {exports: {}};\n\n /*\n * JavaScript Canvas to Blob\n * https://github.com/blueimp/JavaScript-Canvas-to-Blob\n *\n * Copyright 2012, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on stackoverflow user Stoive's code snippet:\n * http://stackoverflow.com/q/4998908\n */\n (function (module) {\n if (typeof window === 'undefined') {\n return;\n }\n (function (window) {\n\n var CanvasPrototype = window.HTMLCanvasElement && window.HTMLCanvasElement.prototype;\n var hasBlobConstructor = window.Blob && function () {\n try {\n return Boolean(new Blob());\n } catch (e) {\n return false;\n }\n }();\n var hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array && function () {\n try {\n return new Blob([new Uint8Array(100)]).size === 100;\n } catch (e) {\n return false;\n }\n }();\n var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;\n var dataURIPattern = /^data:((.*?)(;charset=.*?)?)(;base64)?,/;\n var dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob && window.ArrayBuffer && window.Uint8Array && function (dataURI) {\n var matches, mediaType, isBase64, dataString, byteString, arrayBuffer, intArray, i, bb;\n // Parse the dataURI components as per RFC 2397\n matches = dataURI.match(dataURIPattern);\n if (!matches) {\n throw new Error('invalid data URI');\n }\n // Default to text/plain;charset=US-ASCII\n mediaType = matches[2] ? matches[1] : 'text/plain' + (matches[3] || ';charset=US-ASCII');\n isBase64 = !!matches[4];\n dataString = dataURI.slice(matches[0].length);\n if (isBase64) {\n // Convert base64 to raw binary data held in a string:\n byteString = atob(dataString);\n } else {\n // Convert base64/URLEncoded data component to raw binary:\n byteString = decodeURIComponent(dataString);\n }\n // Write the bytes of the string to an ArrayBuffer:\n arrayBuffer = new ArrayBuffer(byteString.length);\n intArray = new Uint8Array(arrayBuffer);\n for (i = 0; i < byteString.length; i += 1) {\n intArray[i] = byteString.charCodeAt(i);\n }\n // Write the ArrayBuffer (or ArrayBufferView) to a blob:\n if (hasBlobConstructor) {\n return new Blob([hasArrayBufferViewSupport ? intArray : arrayBuffer], {\n type: mediaType\n });\n }\n bb = new BlobBuilder();\n bb.append(arrayBuffer);\n return bb.getBlob(mediaType);\n };\n if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) {\n if (CanvasPrototype.mozGetAsFile) {\n CanvasPrototype.toBlob = function (callback, type, quality) {\n var self = this;\n setTimeout(function () {\n if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) {\n callback(dataURLtoBlob(self.toDataURL(type, quality)));\n } else {\n callback(self.mozGetAsFile('blob', type));\n }\n });\n };\n } else if (CanvasPrototype.toDataURL && dataURLtoBlob) {\n if (CanvasPrototype.msToBlob) {\n CanvasPrototype.toBlob = function (callback, type, quality) {\n var self = this;\n setTimeout(function () {\n if ((type && type !== 'image/png' || quality) && CanvasPrototype.toDataURL && dataURLtoBlob) {\n callback(dataURLtoBlob(self.toDataURL(type, quality)));\n } else {\n callback(self.msToBlob(type));\n }\n });\n };\n } else {\n CanvasPrototype.toBlob = function (callback, type, quality) {\n var self = this;\n setTimeout(function () {\n callback(dataURLtoBlob(self.toDataURL(type, quality)));\n });\n };\n }\n }\n }\n if (module.exports) {\n module.exports = dataURLtoBlob;\n } else {\n window.dataURLtoBlob = dataURLtoBlob;\n }\n })(window);\n })(canvasToBlob);\n var toBlob = canvasToBlob.exports;\n\n var isBlob = function isBlob(value) {\n if (typeof Blob === 'undefined') {\n return false;\n }\n return value instanceof Blob || Object.prototype.toString.call(value) === '[object Blob]';\n };\n\n var DEFAULTS = {\n /**\n * Indicates if output the original image instead of the compressed one\n * when the size of the compressed image is greater than the original one's\n * @type {boolean}\n */\n strict: true,\n /**\n * Indicates if read the image's Exif Orientation information,\n * and then rotate or flip the image automatically.\n * @type {boolean}\n */\n checkOrientation: true,\n /**\n * Indicates if retain the image's Exif information after compressed.\n * @type {boolean}\n */\n retainExif: false,\n /**\n * The max width of the output image.\n * @type {number}\n */\n maxWidth: Infinity,\n /**\n * The max height of the output image.\n * @type {number}\n */\n maxHeight: Infinity,\n /**\n * The min width of the output image.\n * @type {number}\n */\n minWidth: 0,\n /**\n * The min height of the output image.\n * @type {number}\n */\n minHeight: 0,\n /**\n * The width of the output image.\n * If not specified, the natural width of the source image will be used.\n * @type {number}\n */\n width: undefined,\n /**\n * The height of the output image.\n * If not specified, the natural height of the source image will be used.\n * @type {number}\n */\n height: undefined,\n /**\n * Sets how the size of the image should be resized to the container\n * specified by the `width` and `height` options.\n * @type {string}\n */\n resize: 'none',\n /**\n * The quality of the output image.\n * It must be a number between `0` and `1`,\n * and only available for `image/jpeg` and `image/webp` images.\n * Check out {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob canvas.toBlob}.\n * @type {number}\n */\n quality: 0.8,\n /**\n * The mime type of the output image.\n * By default, the original mime type of the source image file will be used.\n * @type {string}\n */\n mimeType: 'auto',\n /**\n * Files whose file type is included in this list,\n * and whose file size exceeds the `convertSize` value will be converted to JPEGs.\n * @type {string\uFF5CArray}\n */\n convertTypes: ['image/png'],\n /**\n * PNG files over this size (5 MB by default) will be converted to JPEGs.\n * To disable this, just set the value to `Infinity`.\n * @type {number}\n */\n convertSize: 5000000,\n /**\n * The hook function to execute before draw the image into the canvas for compression.\n * @type {Function}\n * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.\n * @param {HTMLCanvasElement} canvas - The canvas for compression.\n * @example\n * function (context, canvas) {\n * context.fillStyle = '#fff';\n * }\n */\n beforeDraw: null,\n /**\n * The hook function to execute after drew the image into the canvas for compression.\n * @type {Function}\n * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.\n * @param {HTMLCanvasElement} canvas - The canvas for compression.\n * @example\n * function (context, canvas) {\n * context.filter = 'grayscale(100%)';\n * }\n */\n drew: null,\n /**\n * The hook function to execute when success to compress the image.\n * @type {Function}\n * @param {File} file - The compressed image File object.\n * @example\n * function (file) {\n * console.log(file);\n * }\n */\n success: null,\n /**\n * The hook function to execute when fail to compress the image.\n * @type {Function}\n * @param {Error} err - An Error object.\n * @example\n * function (err) {\n * console.log(err.message);\n * }\n */\n error: null\n };\n\n var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';\n var WINDOW = IS_BROWSER ? window : {};\n\n /**\n * Check if the given value is a positive number.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.\n */\n var isPositiveNumber = function isPositiveNumber(value) {\n return value > 0 && value < Infinity;\n };\n var slice = Array.prototype.slice;\n\n /**\n * Convert array-like or iterable object to an array.\n * @param {*} value - The value to convert.\n * @returns {Array} Returns a new array.\n */\n function toArray(value) {\n return Array.from ? Array.from(value) : slice.call(value);\n }\n var REGEXP_IMAGE_TYPE = /^image\\/.+$/;\n\n /**\n * Check if the given value is a mime type of image.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given is a mime type of image, else `false`.\n */\n function isImageType(value) {\n return REGEXP_IMAGE_TYPE.test(value);\n }\n\n /**\n * Convert image type to extension.\n * @param {string} value - The image type to convert.\n * @returns {boolean} Returns the image extension.\n */\n function imageTypeToExtension(value) {\n var extension = isImageType(value) ? value.substr(6) : '';\n if (extension === 'jpeg') {\n extension = 'jpg';\n }\n return \".\".concat(extension);\n }\n var fromCharCode = String.fromCharCode;\n\n /**\n * Get string from char code in data view.\n * @param {DataView} dataView - The data view for read.\n * @param {number} start - The start index.\n * @param {number} length - The read length.\n * @returns {string} The read result.\n */\n function getStringFromCharCode(dataView, start, length) {\n var str = '';\n var i;\n length += start;\n for (i = start; i < length; i += 1) {\n str += fromCharCode(dataView.getUint8(i));\n }\n return str;\n }\n var btoa = WINDOW.btoa;\n\n /**\n * Transform array buffer to Data URL.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.\n * @param {string} mimeType - The mime type of the Data URL.\n * @returns {string} The result Data URL.\n */\n function arrayBufferToDataURL(arrayBuffer, mimeType) {\n var chunks = [];\n var chunkSize = 8192;\n var uint8 = new Uint8Array(arrayBuffer);\n while (uint8.length > 0) {\n // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9\n // eslint-disable-next-line prefer-spread\n chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));\n uint8 = uint8.subarray(chunkSize);\n }\n return \"data:\".concat(mimeType, \";base64,\").concat(btoa(chunks.join('')));\n }\n\n /**\n * Get orientation value from given array buffer.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to read.\n * @returns {number} The read orientation value.\n */\n function resetAndGetOrientation(arrayBuffer) {\n var dataView = new DataView(arrayBuffer);\n var orientation;\n\n // Ignores range error when the image does not have correct Exif information\n try {\n var littleEndian;\n var app1Start;\n var ifdStart;\n\n // Only handle JPEG image (start by 0xFFD8)\n if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {\n var length = dataView.byteLength;\n var offset = 2;\n while (offset + 1 < length) {\n if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {\n app1Start = offset;\n break;\n }\n offset += 1;\n }\n }\n if (app1Start) {\n var exifIDCode = app1Start + 4;\n var tiffOffset = app1Start + 10;\n if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {\n var endianness = dataView.getUint16(tiffOffset);\n littleEndian = endianness === 0x4949;\n if (littleEndian || endianness === 0x4D4D /* bigEndian */) {\n if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {\n var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);\n if (firstIFDOffset >= 0x00000008) {\n ifdStart = tiffOffset + firstIFDOffset;\n }\n }\n }\n }\n }\n if (ifdStart) {\n var _length = dataView.getUint16(ifdStart, littleEndian);\n var _offset;\n var i;\n for (i = 0; i < _length; i += 1) {\n _offset = ifdStart + i * 12 + 2;\n if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) {\n // 8 is the offset of the current tag's value\n _offset += 8;\n\n // Get the original orientation value\n orientation = dataView.getUint16(_offset, littleEndian);\n\n // Override the orientation with its default value\n dataView.setUint16(_offset, 1, littleEndian);\n break;\n }\n }\n }\n } catch (e) {\n orientation = 1;\n }\n return orientation;\n }\n\n /**\n * Parse Exif Orientation value.\n * @param {number} orientation - The orientation to parse.\n * @returns {Object} The parsed result.\n */\n function parseOrientation(orientation) {\n var rotate = 0;\n var scaleX = 1;\n var scaleY = 1;\n switch (orientation) {\n // Flip horizontal\n case 2:\n scaleX = -1;\n break;\n\n // Rotate left 180\u00B0\n case 3:\n rotate = -180;\n break;\n\n // Flip vertical\n case 4:\n scaleY = -1;\n break;\n\n // Flip vertical and rotate right 90\u00B0\n case 5:\n rotate = 90;\n scaleY = -1;\n break;\n\n // Rotate right 90\u00B0\n case 6:\n rotate = 90;\n break;\n\n // Flip horizontal and rotate right 90\u00B0\n case 7:\n rotate = 90;\n scaleX = -1;\n break;\n\n // Rotate left 90\u00B0\n case 8:\n rotate = -90;\n break;\n }\n return {\n rotate: rotate,\n scaleX: scaleX,\n scaleY: scaleY\n };\n }\n var REGEXP_DECIMALS = /\\.\\d*(?:0|9){12}\\d*$/;\n\n /**\n * Normalize decimal number.\n * Check out {@link https://0.30000000000000004.com/}\n * @param {number} value - The value to normalize.\n * @param {number} [times=100000000000] - The times for normalizing.\n * @returns {number} Returns the normalized number.\n */\n function normalizeDecimalNumber(value) {\n var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;\n return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;\n }\n\n /**\n * Get the max sizes in a rectangle under the given aspect ratio.\n * @param {Object} data - The original sizes.\n * @param {string} [type='contain'] - The adjust type.\n * @returns {Object} The result sizes.\n */\n function getAdjustedSizes(_ref) {\n var aspectRatio = _ref.aspectRatio,\n height = _ref.height,\n width = _ref.width;\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'none';\n var isValidWidth = isPositiveNumber(width);\n var isValidHeight = isPositiveNumber(height);\n if (isValidWidth && isValidHeight) {\n var adjustedWidth = height * aspectRatio;\n if ((type === 'contain' || type === 'none') && adjustedWidth > width || type === 'cover' && adjustedWidth < width) {\n height = width / aspectRatio;\n } else {\n width = height * aspectRatio;\n }\n } else if (isValidWidth) {\n height = width / aspectRatio;\n } else if (isValidHeight) {\n width = height * aspectRatio;\n }\n return {\n width: width,\n height: height\n };\n }\n\n /**\n * Get Exif information from the given array buffer.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to read.\n * @returns {Array} The read Exif information.\n */\n function getExif(arrayBuffer) {\n var array = toArray(new Uint8Array(arrayBuffer));\n var length = array.length;\n var segments = [];\n var start = 0;\n while (start + 3 < length) {\n var value = array[start];\n var next = array[start + 1];\n\n // SOS (Start of Scan)\n if (value === 0xFF && next === 0xDA) {\n break;\n }\n\n // SOI (Start of Image)\n if (value === 0xFF && next === 0xD8) {\n start += 2;\n } else {\n var offset = array[start + 2] * 256 + array[start + 3];\n var end = start + offset + 2;\n var segment = array.slice(start, end);\n segments.push(segment);\n start = end;\n }\n }\n return segments.reduce(function (exifArray, current) {\n if (current[0] === 0xFF && current[1] === 0xE1) {\n return exifArray.concat(current);\n }\n return exifArray;\n }, []);\n }\n\n /**\n * Insert Exif information into the given array buffer.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.\n * @param {Array} exifArray - The Exif information to insert.\n * @returns {ArrayBuffer} The transformed array buffer.\n */\n function insertExif(arrayBuffer, exifArray) {\n var array = toArray(new Uint8Array(arrayBuffer));\n if (array[2] !== 0xFF || array[3] !== 0xE0) {\n return arrayBuffer;\n }\n var app0Length = array[4] * 256 + array[5];\n var newArrayBuffer = [0xFF, 0xD8].concat(exifArray, array.slice(4 + app0Length));\n return new Uint8Array(newArrayBuffer);\n }\n\n var ArrayBuffer$1 = WINDOW.ArrayBuffer,\n FileReader = WINDOW.FileReader;\n var URL = WINDOW.URL || WINDOW.webkitURL;\n var REGEXP_EXTENSION = /\\.\\w+$/;\n var AnotherCompressor = WINDOW.Compressor;\n\n /**\n * Creates a new image compressor.\n * @class\n */\n var Compressor = /*#__PURE__*/function () {\n /**\n * The constructor of Compressor.\n * @param {File|Blob} file - The target image file for compressing.\n * @param {Object} [options] - The options for compressing.\n */\n function Compressor(file, options) {\n _classCallCheck(this, Compressor);\n this.file = file;\n this.exif = [];\n this.image = new Image();\n this.options = _objectSpread2(_objectSpread2({}, DEFAULTS), options);\n this.aborted = false;\n this.result = null;\n this.init();\n }\n _createClass(Compressor, [{\n key: \"init\",\n value: function init() {\n var _this = this;\n var file = this.file,\n options = this.options;\n if (!isBlob(file)) {\n this.fail(new Error('The first argument must be a File or Blob object.'));\n return;\n }\n var mimeType = file.type;\n if (!isImageType(mimeType)) {\n this.fail(new Error('The first argument must be an image File or Blob object.'));\n return;\n }\n if (!URL || !FileReader) {\n this.fail(new Error('The current browser does not support image compression.'));\n return;\n }\n if (!ArrayBuffer$1) {\n options.checkOrientation = false;\n options.retainExif = false;\n }\n var isJPEGImage = mimeType === 'image/jpeg';\n var checkOrientation = isJPEGImage && options.checkOrientation;\n var retainExif = isJPEGImage && options.retainExif;\n if (URL && !checkOrientation && !retainExif) {\n this.load({\n url: URL.createObjectURL(file)\n });\n } else {\n var reader = new FileReader();\n this.reader = reader;\n reader.onload = function (_ref) {\n var target = _ref.target;\n var result = target.result;\n var data = {};\n var orientation = 1;\n if (checkOrientation) {\n // Reset the orientation value to its default value 1\n // as some iOS browsers will render image with its orientation\n orientation = resetAndGetOrientation(result);\n if (orientation > 1) {\n _extends(data, parseOrientation(orientation));\n }\n }\n if (retainExif) {\n _this.exif = getExif(result);\n }\n if (checkOrientation || retainExif) {\n if (!URL\n\n // Generate a new URL with the default orientation value 1.\n || orientation > 1) {\n data.url = arrayBufferToDataURL(result, mimeType);\n } else {\n data.url = URL.createObjectURL(file);\n }\n } else {\n data.url = result;\n }\n _this.load(data);\n };\n reader.onabort = function () {\n _this.fail(new Error('Aborted to read the image with FileReader.'));\n };\n reader.onerror = function () {\n _this.fail(new Error('Failed to read the image with FileReader.'));\n };\n reader.onloadend = function () {\n _this.reader = null;\n };\n if (checkOrientation || retainExif) {\n reader.readAsArrayBuffer(file);\n } else {\n reader.readAsDataURL(file);\n }\n }\n }\n }, {\n key: \"load\",\n value: function load(data) {\n var _this2 = this;\n var file = this.file,\n image = this.image;\n image.onload = function () {\n _this2.draw(_objectSpread2(_objectSpread2({}, data), {}, {\n naturalWidth: image.naturalWidth,\n naturalHeight: image.naturalHeight\n }));\n };\n image.onabort = function () {\n _this2.fail(new Error('Aborted to load the image.'));\n };\n image.onerror = function () {\n _this2.fail(new Error('Failed to load the image.'));\n };\n\n // Match all browsers that use WebKit as the layout engine in iOS devices,\n // such as Safari for iOS, Chrome for iOS, and in-app browsers.\n if (WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent)) {\n // Fix the `The operation is insecure` error (#57)\n image.crossOrigin = 'anonymous';\n }\n image.alt = file.name;\n image.src = data.url;\n }\n }, {\n key: \"draw\",\n value: function draw(_ref2) {\n var _this3 = this;\n var naturalWidth = _ref2.naturalWidth,\n naturalHeight = _ref2.naturalHeight,\n _ref2$rotate = _ref2.rotate,\n rotate = _ref2$rotate === void 0 ? 0 : _ref2$rotate,\n _ref2$scaleX = _ref2.scaleX,\n scaleX = _ref2$scaleX === void 0 ? 1 : _ref2$scaleX,\n _ref2$scaleY = _ref2.scaleY,\n scaleY = _ref2$scaleY === void 0 ? 1 : _ref2$scaleY;\n var file = this.file,\n image = this.image,\n options = this.options;\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n var is90DegreesRotated = Math.abs(rotate) % 180 === 90;\n var resizable = (options.resize === 'contain' || options.resize === 'cover') && isPositiveNumber(options.width) && isPositiveNumber(options.height);\n var maxWidth = Math.max(options.maxWidth, 0) || Infinity;\n var maxHeight = Math.max(options.maxHeight, 0) || Infinity;\n var minWidth = Math.max(options.minWidth, 0) || 0;\n var minHeight = Math.max(options.minHeight, 0) || 0;\n var aspectRatio = naturalWidth / naturalHeight;\n var width = options.width,\n height = options.height;\n if (is90DegreesRotated) {\n var _ref3 = [maxHeight, maxWidth];\n maxWidth = _ref3[0];\n maxHeight = _ref3[1];\n var _ref4 = [minHeight, minWidth];\n minWidth = _ref4[0];\n minHeight = _ref4[1];\n var _ref5 = [height, width];\n width = _ref5[0];\n height = _ref5[1];\n }\n if (resizable) {\n aspectRatio = width / height;\n }\n var _getAdjustedSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: maxWidth,\n height: maxHeight\n }, 'contain');\n maxWidth = _getAdjustedSizes.width;\n maxHeight = _getAdjustedSizes.height;\n var _getAdjustedSizes2 = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: minWidth,\n height: minHeight\n }, 'cover');\n minWidth = _getAdjustedSizes2.width;\n minHeight = _getAdjustedSizes2.height;\n if (resizable) {\n var _getAdjustedSizes3 = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: width,\n height: height\n }, options.resize);\n width = _getAdjustedSizes3.width;\n height = _getAdjustedSizes3.height;\n } else {\n var _getAdjustedSizes4 = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: width,\n height: height\n });\n var _getAdjustedSizes4$wi = _getAdjustedSizes4.width;\n width = _getAdjustedSizes4$wi === void 0 ? naturalWidth : _getAdjustedSizes4$wi;\n var _getAdjustedSizes4$he = _getAdjustedSizes4.height;\n height = _getAdjustedSizes4$he === void 0 ? naturalHeight : _getAdjustedSizes4$he;\n }\n width = Math.floor(normalizeDecimalNumber(Math.min(Math.max(width, minWidth), maxWidth)));\n height = Math.floor(normalizeDecimalNumber(Math.min(Math.max(height, minHeight), maxHeight)));\n var destX = -width / 2;\n var destY = -height / 2;\n var destWidth = width;\n var destHeight = height;\n var params = [];\n if (resizable) {\n var srcX = 0;\n var srcY = 0;\n var srcWidth = naturalWidth;\n var srcHeight = naturalHeight;\n var _getAdjustedSizes5 = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: naturalWidth,\n height: naturalHeight\n }, {\n contain: 'cover',\n cover: 'contain'\n }[options.resize]);\n srcWidth = _getAdjustedSizes5.width;\n srcHeight = _getAdjustedSizes5.height;\n srcX = (naturalWidth - srcWidth) / 2;\n srcY = (naturalHeight - srcHeight) / 2;\n params.push(srcX, srcY, srcWidth, srcHeight);\n }\n params.push(destX, destY, destWidth, destHeight);\n if (is90DegreesRotated) {\n var _ref6 = [height, width];\n width = _ref6[0];\n height = _ref6[1];\n }\n canvas.width = width;\n canvas.height = height;\n if (!isImageType(options.mimeType)) {\n options.mimeType = file.type;\n }\n var fillStyle = 'transparent';\n\n // Converts PNG files over the `convertSize` to JPEGs.\n if (file.size > options.convertSize && options.convertTypes.indexOf(options.mimeType) >= 0) {\n options.mimeType = 'image/jpeg';\n }\n var isJPEGImage = options.mimeType === 'image/jpeg';\n if (isJPEGImage) {\n fillStyle = '#fff';\n }\n\n // Override the default fill color (#000, black)\n context.fillStyle = fillStyle;\n context.fillRect(0, 0, width, height);\n if (options.beforeDraw) {\n options.beforeDraw.call(this, context, canvas);\n }\n if (this.aborted) {\n return;\n }\n context.save();\n context.translate(width / 2, height / 2);\n context.rotate(rotate * Math.PI / 180);\n context.scale(scaleX, scaleY);\n context.drawImage.apply(context, [image].concat(params));\n context.restore();\n if (options.drew) {\n options.drew.call(this, context, canvas);\n }\n if (this.aborted) {\n return;\n }\n var callback = function callback(blob) {\n if (!_this3.aborted) {\n var done = function done(result) {\n return _this3.done({\n naturalWidth: naturalWidth,\n naturalHeight: naturalHeight,\n result: result\n });\n };\n if (blob && isJPEGImage && options.retainExif && _this3.exif && _this3.exif.length > 0) {\n var next = function next(arrayBuffer) {\n return done(toBlob(arrayBufferToDataURL(insertExif(arrayBuffer, _this3.exif), options.mimeType)));\n };\n if (blob.arrayBuffer) {\n blob.arrayBuffer().then(next).catch(function () {\n _this3.fail(new Error('Failed to read the compressed image with Blob.arrayBuffer().'));\n });\n } else {\n var reader = new FileReader();\n _this3.reader = reader;\n reader.onload = function (_ref7) {\n var target = _ref7.target;\n next(target.result);\n };\n reader.onabort = function () {\n _this3.fail(new Error('Aborted to read the compressed image with FileReader.'));\n };\n reader.onerror = function () {\n _this3.fail(new Error('Failed to read the compressed image with FileReader.'));\n };\n reader.onloadend = function () {\n _this3.reader = null;\n };\n reader.readAsArrayBuffer(blob);\n }\n } else {\n done(blob);\n }\n }\n };\n if (canvas.toBlob) {\n canvas.toBlob(callback, options.mimeType, options.quality);\n } else {\n callback(toBlob(canvas.toDataURL(options.mimeType, options.quality)));\n }\n }\n }, {\n key: \"done\",\n value: function done(_ref8) {\n var naturalWidth = _ref8.naturalWidth,\n naturalHeight = _ref8.naturalHeight,\n result = _ref8.result;\n var file = this.file,\n image = this.image,\n options = this.options;\n if (URL && image.src.indexOf('blob:') === 0) {\n URL.revokeObjectURL(image.src);\n }\n if (result) {\n // Returns original file if the result is greater than it and without size related options\n if (options.strict && !options.retainExif && result.size > file.size && options.mimeType === file.type && !(options.width > naturalWidth || options.height > naturalHeight || options.minWidth > naturalWidth || options.minHeight > naturalHeight || options.maxWidth < naturalWidth || options.maxHeight < naturalHeight)) {\n result = file;\n } else {\n var date = new Date();\n result.lastModified = date.getTime();\n result.lastModifiedDate = date;\n result.name = file.name;\n\n // Convert the extension to match its type\n if (result.name && result.type !== file.type) {\n result.name = result.name.replace(REGEXP_EXTENSION, imageTypeToExtension(result.type));\n }\n }\n } else {\n // Returns original file if the result is null in some cases.\n result = file;\n }\n this.result = result;\n if (options.success) {\n options.success.call(this, result);\n }\n }\n }, {\n key: \"fail\",\n value: function fail(err) {\n var options = this.options;\n if (options.error) {\n options.error.call(this, err);\n } else {\n throw err;\n }\n }\n }, {\n key: \"abort\",\n value: function abort() {\n if (!this.aborted) {\n this.aborted = true;\n if (this.reader) {\n this.reader.abort();\n } else if (!this.image.complete) {\n this.image.onload = null;\n this.image.onabort();\n } else {\n this.fail(new Error('The compression process has been aborted.'));\n }\n }\n }\n\n /**\n * Get the no conflict compressor class.\n * @returns {Compressor} The compressor class.\n */\n }], [{\n key: \"noConflict\",\n value: function noConflict() {\n window.Compressor = AnotherCompressor;\n return Compressor;\n }\n\n /**\n * Change the default options.\n * @param {Object} options - The new default options.\n */\n }, {\n key: \"setDefaults\",\n value: function setDefaults(options) {\n _extends(DEFAULTS, options);\n }\n }]);\n return Compressor;\n }();\n\n return Compressor;\n\n}));\n", "/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n", "/*!\nTurbo 8.0.12\nCopyright \u00A9 2024 37signals LLC\n */\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2019 Javan Makhmali\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n(function (prototype) {\n if (typeof prototype.requestSubmit == \"function\") return\n\n prototype.requestSubmit = function (submitter) {\n if (submitter) {\n validateSubmitter(submitter, this);\n submitter.click();\n } else {\n submitter = document.createElement(\"input\");\n submitter.type = \"submit\";\n submitter.hidden = true;\n this.appendChild(submitter);\n submitter.click();\n this.removeChild(submitter);\n }\n };\n\n function validateSubmitter(submitter, form) {\n submitter instanceof HTMLElement || raise(TypeError, \"parameter 1 is not of type 'HTMLElement'\");\n submitter.type == \"submit\" || raise(TypeError, \"The specified element is not a submit button\");\n submitter.form == form ||\n raise(DOMException, \"The specified element is not owned by this form element\", \"NotFoundError\");\n }\n\n function raise(errorConstructor, message, name) {\n throw new errorConstructor(\"Failed to execute 'requestSubmit' on 'HTMLFormElement': \" + message + \".\", name)\n }\n})(HTMLFormElement.prototype);\n\nconst submittersByForm = new WeakMap();\n\nfunction findSubmitterFromClickTarget(target) {\n const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n const candidate = element ? element.closest(\"input, button\") : null;\n return candidate?.type == \"submit\" ? candidate : null\n}\n\nfunction clickCaptured(event) {\n const submitter = findSubmitterFromClickTarget(event.target);\n\n if (submitter && submitter.form) {\n submittersByForm.set(submitter.form, submitter);\n }\n}\n\n(function () {\n if (\"submitter\" in Event.prototype) return\n\n let prototype = window.Event.prototype;\n // Certain versions of Safari 15 have a bug where they won't\n // populate the submitter. This hurts TurboDrive's enable/disable detection.\n // See https://bugs.webkit.org/show_bug.cgi?id=229660\n if (\"SubmitEvent\" in window) {\n const prototypeOfSubmitEvent = window.SubmitEvent.prototype;\n\n if (/Apple Computer/.test(navigator.vendor) && !(\"submitter\" in prototypeOfSubmitEvent)) {\n prototype = prototypeOfSubmitEvent;\n } else {\n return // polyfill not needed\n }\n }\n\n addEventListener(\"click\", clickCaptured, true);\n\n Object.defineProperty(prototype, \"submitter\", {\n get() {\n if (this.type == \"submit\" && this.target instanceof HTMLFormElement) {\n return submittersByForm.get(this.target)\n }\n }\n });\n})();\n\nconst FrameLoadingStyle = {\n eager: \"eager\",\n lazy: \"lazy\"\n};\n\n/**\n * Contains a fragment of HTML which is updated based on navigation within\n * it (e.g. via links or form submissions).\n *\n * @customElement turbo-frame\n * @example\n * <turbo-frame id=\"messages\">\n * <a href=\"/messages/expanded\">\n * Show all expanded messages in this frame.\n * </a>\n *\n * <form action=\"/messages\">\n * Show response from this form within this frame.\n * </form>\n * </turbo-frame>\n */\nclass FrameElement extends HTMLElement {\n static delegateConstructor = undefined\n\n loaded = Promise.resolve()\n\n static get observedAttributes() {\n return [\"disabled\", \"loading\", \"src\"]\n }\n\n constructor() {\n super();\n this.delegate = new FrameElement.delegateConstructor(this);\n }\n\n connectedCallback() {\n this.delegate.connect();\n }\n\n disconnectedCallback() {\n this.delegate.disconnect();\n }\n\n reload() {\n return this.delegate.sourceURLReloaded()\n }\n\n attributeChangedCallback(name) {\n if (name == \"loading\") {\n this.delegate.loadingStyleChanged();\n } else if (name == \"src\") {\n this.delegate.sourceURLChanged();\n } else if (name == \"disabled\") {\n this.delegate.disabledChanged();\n }\n }\n\n /**\n * Gets the URL to lazily load source HTML from\n */\n get src() {\n return this.getAttribute(\"src\")\n }\n\n /**\n * Sets the URL to lazily load source HTML from\n */\n set src(value) {\n if (value) {\n this.setAttribute(\"src\", value);\n } else {\n this.removeAttribute(\"src\");\n }\n }\n\n /**\n * Gets the refresh mode for the frame.\n */\n get refresh() {\n return this.getAttribute(\"refresh\")\n }\n\n /**\n * Sets the refresh mode for the frame.\n */\n set refresh(value) {\n if (value) {\n this.setAttribute(\"refresh\", value);\n } else {\n this.removeAttribute(\"refresh\");\n }\n }\n\n get shouldReloadWithMorph() {\n return this.src && this.refresh === \"morph\"\n }\n\n /**\n * Determines if the element is loading\n */\n get loading() {\n return frameLoadingStyleFromString(this.getAttribute(\"loading\") || \"\")\n }\n\n /**\n * Sets the value of if the element is loading\n */\n set loading(value) {\n if (value) {\n this.setAttribute(\"loading\", value);\n } else {\n this.removeAttribute(\"loading\");\n }\n }\n\n /**\n * Gets the disabled state of the frame.\n *\n * If disabled, no requests will be intercepted by the frame.\n */\n get disabled() {\n return this.hasAttribute(\"disabled\")\n }\n\n /**\n * Sets the disabled state of the frame.\n *\n * If disabled, no requests will be intercepted by the frame.\n */\n set disabled(value) {\n if (value) {\n this.setAttribute(\"disabled\", \"\");\n } else {\n this.removeAttribute(\"disabled\");\n }\n }\n\n /**\n * Gets the autoscroll state of the frame.\n *\n * If true, the frame will be scrolled into view automatically on update.\n */\n get autoscroll() {\n return this.hasAttribute(\"autoscroll\")\n }\n\n /**\n * Sets the autoscroll state of the frame.\n *\n * If true, the frame will be scrolled into view automatically on update.\n */\n set autoscroll(value) {\n if (value) {\n this.setAttribute(\"autoscroll\", \"\");\n } else {\n this.removeAttribute(\"autoscroll\");\n }\n }\n\n /**\n * Determines if the element has finished loading\n */\n get complete() {\n return !this.delegate.isLoading\n }\n\n /**\n * Gets the active state of the frame.\n *\n * If inactive, source changes will not be observed.\n */\n get isActive() {\n return this.ownerDocument === document && !this.isPreview\n }\n\n /**\n * Sets the active state of the frame.\n *\n * If inactive, source changes will not be observed.\n */\n get isPreview() {\n return this.ownerDocument?.documentElement?.hasAttribute(\"data-turbo-preview\")\n }\n}\n\nfunction frameLoadingStyleFromString(style) {\n switch (style.toLowerCase()) {\n case \"lazy\":\n return FrameLoadingStyle.lazy\n default:\n return FrameLoadingStyle.eager\n }\n}\n\nconst drive = {\n enabled: true,\n progressBarDelay: 500,\n unvisitableExtensions: new Set(\n [\n \".7z\", \".aac\", \".apk\", \".avi\", \".bmp\", \".bz2\", \".css\", \".csv\", \".deb\", \".dmg\", \".doc\",\n \".docx\", \".exe\", \".gif\", \".gz\", \".heic\", \".heif\", \".ico\", \".iso\", \".jpeg\", \".jpg\",\n \".js\", \".json\", \".m4a\", \".mkv\", \".mov\", \".mp3\", \".mp4\", \".mpeg\", \".mpg\", \".msi\",\n \".ogg\", \".ogv\", \".pdf\", \".pkg\", \".png\", \".ppt\", \".pptx\", \".rar\", \".rtf\",\n \".svg\", \".tar\", \".tif\", \".tiff\", \".txt\", \".wav\", \".webm\", \".webp\", \".wma\", \".wmv\",\n \".xls\", \".xlsx\", \".xml\", \".zip\"\n ]\n )\n};\n\nfunction activateScriptElement(element) {\n if (element.getAttribute(\"data-turbo-eval\") == \"false\") {\n return element\n } else {\n const createdScriptElement = document.createElement(\"script\");\n const cspNonce = getCspNonce();\n if (cspNonce) {\n createdScriptElement.nonce = cspNonce;\n }\n createdScriptElement.textContent = element.textContent;\n createdScriptElement.async = false;\n copyElementAttributes(createdScriptElement, element);\n return createdScriptElement\n }\n}\n\nfunction copyElementAttributes(destinationElement, sourceElement) {\n for (const { name, value } of sourceElement.attributes) {\n destinationElement.setAttribute(name, value);\n }\n}\n\nfunction createDocumentFragment(html) {\n const template = document.createElement(\"template\");\n template.innerHTML = html;\n return template.content\n}\n\nfunction dispatch(eventName, { target, cancelable, detail } = {}) {\n const event = new CustomEvent(eventName, {\n cancelable,\n bubbles: true,\n composed: true,\n detail\n });\n\n if (target && target.isConnected) {\n target.dispatchEvent(event);\n } else {\n document.documentElement.dispatchEvent(event);\n }\n\n return event\n}\n\nfunction cancelEvent(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n\nfunction nextRepaint() {\n if (document.visibilityState === \"hidden\") {\n return nextEventLoopTick()\n } else {\n return nextAnimationFrame()\n }\n}\n\nfunction nextAnimationFrame() {\n return new Promise((resolve) => requestAnimationFrame(() => resolve()))\n}\n\nfunction nextEventLoopTick() {\n return new Promise((resolve) => setTimeout(() => resolve(), 0))\n}\n\nfunction nextMicrotask() {\n return Promise.resolve()\n}\n\nfunction parseHTMLDocument(html = \"\") {\n return new DOMParser().parseFromString(html, \"text/html\")\n}\n\nfunction unindent(strings, ...values) {\n const lines = interpolate(strings, values).replace(/^\\n/, \"\").split(\"\\n\");\n const match = lines[0].match(/^\\s+/);\n const indent = match ? match[0].length : 0;\n return lines.map((line) => line.slice(indent)).join(\"\\n\")\n}\n\nfunction interpolate(strings, values) {\n return strings.reduce((result, string, i) => {\n const value = values[i] == undefined ? \"\" : values[i];\n return result + string + value\n }, \"\")\n}\n\nfunction uuid() {\n return Array.from({ length: 36 })\n .map((_, i) => {\n if (i == 8 || i == 13 || i == 18 || i == 23) {\n return \"-\"\n } else if (i == 14) {\n return \"4\"\n } else if (i == 19) {\n return (Math.floor(Math.random() * 4) + 8).toString(16)\n } else {\n return Math.floor(Math.random() * 15).toString(16)\n }\n })\n .join(\"\")\n}\n\nfunction getAttribute(attributeName, ...elements) {\n for (const value of elements.map((element) => element?.getAttribute(attributeName))) {\n if (typeof value == \"string\") return value\n }\n\n return null\n}\n\nfunction hasAttribute(attributeName, ...elements) {\n return elements.some((element) => element && element.hasAttribute(attributeName))\n}\n\nfunction markAsBusy(...elements) {\n for (const element of elements) {\n if (element.localName == \"turbo-frame\") {\n element.setAttribute(\"busy\", \"\");\n }\n element.setAttribute(\"aria-busy\", \"true\");\n }\n}\n\nfunction clearBusyState(...elements) {\n for (const element of elements) {\n if (element.localName == \"turbo-frame\") {\n element.removeAttribute(\"busy\");\n }\n\n element.removeAttribute(\"aria-busy\");\n }\n}\n\nfunction waitForLoad(element, timeoutInMilliseconds = 2000) {\n return new Promise((resolve) => {\n const onComplete = () => {\n element.removeEventListener(\"error\", onComplete);\n element.removeEventListener(\"load\", onComplete);\n resolve();\n };\n\n element.addEventListener(\"load\", onComplete, { once: true });\n element.addEventListener(\"error\", onComplete, { once: true });\n setTimeout(resolve, timeoutInMilliseconds);\n })\n}\n\nfunction getHistoryMethodForAction(action) {\n switch (action) {\n case \"replace\":\n return history.replaceState\n case \"advance\":\n case \"restore\":\n return history.pushState\n }\n}\n\nfunction isAction(action) {\n return action == \"advance\" || action == \"replace\" || action == \"restore\"\n}\n\nfunction getVisitAction(...elements) {\n const action = getAttribute(\"data-turbo-action\", ...elements);\n\n return isAction(action) ? action : null\n}\n\nfunction getMetaElement(name) {\n return document.querySelector(`meta[name=\"${name}\"]`)\n}\n\nfunction getMetaContent(name) {\n const element = getMetaElement(name);\n return element && element.content\n}\n\nfunction getCspNonce() {\n const element = getMetaElement(\"csp-nonce\");\n\n if (element) {\n const { nonce, content } = element;\n return nonce == \"\" ? content : nonce\n }\n}\n\nfunction setMetaContent(name, content) {\n let element = getMetaElement(name);\n\n if (!element) {\n element = document.createElement(\"meta\");\n element.setAttribute(\"name\", name);\n\n document.head.appendChild(element);\n }\n\n element.setAttribute(\"content\", content);\n\n return element\n}\n\nfunction findClosestRecursively(element, selector) {\n if (element instanceof Element) {\n return (\n element.closest(selector) || findClosestRecursively(element.assignedSlot || element.getRootNode()?.host, selector)\n )\n }\n}\n\nfunction elementIsFocusable(element) {\n const inertDisabledOrHidden = \"[inert], :disabled, [hidden], details:not([open]), dialog:not([open])\";\n\n return !!element && element.closest(inertDisabledOrHidden) == null && typeof element.focus == \"function\"\n}\n\nfunction queryAutofocusableElement(elementOrDocumentFragment) {\n return Array.from(elementOrDocumentFragment.querySelectorAll(\"[autofocus]\")).find(elementIsFocusable)\n}\n\nasync function around(callback, reader) {\n const before = reader();\n\n callback();\n\n await nextAnimationFrame();\n\n const after = reader();\n\n return [before, after]\n}\n\nfunction doesNotTargetIFrame(name) {\n if (name === \"_blank\") {\n return false\n } else if (name) {\n for (const element of document.getElementsByName(name)) {\n if (element instanceof HTMLIFrameElement) return false\n }\n\n return true\n } else {\n return true\n }\n}\n\nfunction findLinkFromClickTarget(target) {\n return findClosestRecursively(target, \"a[href]:not([target^=_]):not([download])\")\n}\n\nfunction getLocationForLink(link) {\n return expandURL(link.getAttribute(\"href\") || \"\")\n}\n\nfunction debounce(fn, delay) {\n let timeoutId = null;\n\n return (...args) => {\n const callback = () => fn.apply(this, args);\n clearTimeout(timeoutId);\n timeoutId = setTimeout(callback, delay);\n }\n}\n\nconst submitter = {\n \"aria-disabled\": {\n beforeSubmit: submitter => {\n submitter.setAttribute(\"aria-disabled\", \"true\");\n submitter.addEventListener(\"click\", cancelEvent);\n },\n\n afterSubmit: submitter => {\n submitter.removeAttribute(\"aria-disabled\");\n submitter.removeEventListener(\"click\", cancelEvent);\n }\n },\n\n \"disabled\": {\n beforeSubmit: submitter => submitter.disabled = true,\n afterSubmit: submitter => submitter.disabled = false\n }\n};\n\nclass Config {\n #submitter = null\n\n constructor(config) {\n Object.assign(this, config);\n }\n\n get submitter() {\n return this.#submitter\n }\n\n set submitter(value) {\n this.#submitter = submitter[value] || value;\n }\n}\n\nconst forms = new Config({\n mode: \"on\",\n submitter: \"disabled\"\n});\n\nconst config = {\n drive,\n forms\n};\n\nfunction expandURL(locatable) {\n return new URL(locatable.toString(), document.baseURI)\n}\n\nfunction getAnchor(url) {\n let anchorMatch;\n if (url.hash) {\n return url.hash.slice(1)\n // eslint-disable-next-line no-cond-assign\n } else if ((anchorMatch = url.href.match(/#(.*)$/))) {\n return anchorMatch[1]\n }\n}\n\nfunction getAction$1(form, submitter) {\n const action = submitter?.getAttribute(\"formaction\") || form.getAttribute(\"action\") || form.action;\n\n return expandURL(action)\n}\n\nfunction getExtension(url) {\n return (getLastPathComponent(url).match(/\\.[^.]*$/) || [])[0] || \"\"\n}\n\nfunction isPrefixedBy(baseURL, url) {\n const prefix = getPrefix(url);\n return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix)\n}\n\nfunction locationIsVisitable(location, rootLocation) {\n return isPrefixedBy(location, rootLocation) && !config.drive.unvisitableExtensions.has(getExtension(location))\n}\n\nfunction getRequestURL(url) {\n const anchor = getAnchor(url);\n return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href\n}\n\nfunction toCacheKey(url) {\n return getRequestURL(url)\n}\n\nfunction urlsAreEqual(left, right) {\n return expandURL(left).href == expandURL(right).href\n}\n\nfunction getPathComponents(url) {\n return url.pathname.split(\"/\").slice(1)\n}\n\nfunction getLastPathComponent(url) {\n return getPathComponents(url).slice(-1)[0]\n}\n\nfunction getPrefix(url) {\n return addTrailingSlash(url.origin + url.pathname)\n}\n\nfunction addTrailingSlash(value) {\n return value.endsWith(\"/\") ? value : value + \"/\"\n}\n\nclass FetchResponse {\n constructor(response) {\n this.response = response;\n }\n\n get succeeded() {\n return this.response.ok\n }\n\n get failed() {\n return !this.succeeded\n }\n\n get clientError() {\n return this.statusCode >= 400 && this.statusCode <= 499\n }\n\n get serverError() {\n return this.statusCode >= 500 && this.statusCode <= 599\n }\n\n get redirected() {\n return this.response.redirected\n }\n\n get location() {\n return expandURL(this.response.url)\n }\n\n get isHTML() {\n return this.contentType && this.contentType.match(/^(?:text\\/([^\\s;,]+\\b)?html|application\\/xhtml\\+xml)\\b/)\n }\n\n get statusCode() {\n return this.response.status\n }\n\n get contentType() {\n return this.header(\"Content-Type\")\n }\n\n get responseText() {\n return this.response.clone().text()\n }\n\n get responseHTML() {\n if (this.isHTML) {\n return this.response.clone().text()\n } else {\n return Promise.resolve(undefined)\n }\n }\n\n header(name) {\n return this.response.headers.get(name)\n }\n}\n\nclass LimitedSet extends Set {\n constructor(maxSize) {\n super();\n this.maxSize = maxSize;\n }\n\n add(value) {\n if (this.size >= this.maxSize) {\n const iterator = this.values();\n const oldestValue = iterator.next().value;\n this.delete(oldestValue);\n }\n super.add(value);\n }\n}\n\nconst recentRequests = new LimitedSet(20);\n\nconst nativeFetch = window.fetch;\n\nfunction fetchWithTurboHeaders(url, options = {}) {\n const modifiedHeaders = new Headers(options.headers || {});\n const requestUID = uuid();\n recentRequests.add(requestUID);\n modifiedHeaders.append(\"X-Turbo-Request-Id\", requestUID);\n\n return nativeFetch(url, {\n ...options,\n headers: modifiedHeaders\n })\n}\n\nfunction fetchMethodFromString(method) {\n switch (method.toLowerCase()) {\n case \"get\":\n return FetchMethod.get\n case \"post\":\n return FetchMethod.post\n case \"put\":\n return FetchMethod.put\n case \"patch\":\n return FetchMethod.patch\n case \"delete\":\n return FetchMethod.delete\n }\n}\n\nconst FetchMethod = {\n get: \"get\",\n post: \"post\",\n put: \"put\",\n patch: \"patch\",\n delete: \"delete\"\n};\n\nfunction fetchEnctypeFromString(encoding) {\n switch (encoding.toLowerCase()) {\n case FetchEnctype.multipart:\n return FetchEnctype.multipart\n case FetchEnctype.plain:\n return FetchEnctype.plain\n default:\n return FetchEnctype.urlEncoded\n }\n}\n\nconst FetchEnctype = {\n urlEncoded: \"application/x-www-form-urlencoded\",\n multipart: \"multipart/form-data\",\n plain: \"text/plain\"\n};\n\nclass FetchRequest {\n abortController = new AbortController()\n #resolveRequestPromise = (_value) => {}\n\n constructor(delegate, method, location, requestBody = new URLSearchParams(), target = null, enctype = FetchEnctype.urlEncoded) {\n const [url, body] = buildResourceAndBody(expandURL(location), method, requestBody, enctype);\n\n this.delegate = delegate;\n this.url = url;\n this.target = target;\n this.fetchOptions = {\n credentials: \"same-origin\",\n redirect: \"follow\",\n method: method.toUpperCase(),\n headers: { ...this.defaultHeaders },\n body: body,\n signal: this.abortSignal,\n referrer: this.delegate.referrer?.href\n };\n this.enctype = enctype;\n }\n\n get method() {\n return this.fetchOptions.method\n }\n\n set method(value) {\n const fetchBody = this.isSafe ? this.url.searchParams : this.fetchOptions.body || new FormData();\n const fetchMethod = fetchMethodFromString(value) || FetchMethod.get;\n\n this.url.search = \"\";\n\n const [url, body] = buildResourceAndBody(this.url, fetchMethod, fetchBody, this.enctype);\n\n this.url = url;\n this.fetchOptions.body = body;\n this.fetchOptions.method = fetchMethod.toUpperCase();\n }\n\n get headers() {\n return this.fetchOptions.headers\n }\n\n set headers(value) {\n this.fetchOptions.headers = value;\n }\n\n get body() {\n if (this.isSafe) {\n return this.url.searchParams\n } else {\n return this.fetchOptions.body\n }\n }\n\n set body(value) {\n this.fetchOptions.body = value;\n }\n\n get location() {\n return this.url\n }\n\n get params() {\n return this.url.searchParams\n }\n\n get entries() {\n return this.body ? Array.from(this.body.entries()) : []\n }\n\n cancel() {\n this.abortController.abort();\n }\n\n async perform() {\n const { fetchOptions } = this;\n this.delegate.prepareRequest(this);\n const event = await this.#allowRequestToBeIntercepted(fetchOptions);\n try {\n this.delegate.requestStarted(this);\n\n if (event.detail.fetchRequest) {\n this.response = event.detail.fetchRequest.response;\n } else {\n this.response = fetchWithTurboHeaders(this.url.href, fetchOptions);\n }\n\n const response = await this.response;\n return await this.receive(response)\n } catch (error) {\n if (error.name !== \"AbortError\") {\n if (this.#willDelegateErrorHandling(error)) {\n this.delegate.requestErrored(this, error);\n }\n throw error\n }\n } finally {\n this.delegate.requestFinished(this);\n }\n }\n\n async receive(response) {\n const fetchResponse = new FetchResponse(response);\n const event = dispatch(\"turbo:before-fetch-response\", {\n cancelable: true,\n detail: { fetchResponse },\n target: this.target\n });\n if (event.defaultPrevented) {\n this.delegate.requestPreventedHandlingResponse(this, fetchResponse);\n } else if (fetchResponse.succeeded) {\n this.delegate.requestSucceededWithResponse(this, fetchResponse);\n } else {\n this.delegate.requestFailedWithResponse(this, fetchResponse);\n }\n return fetchResponse\n }\n\n get defaultHeaders() {\n return {\n Accept: \"text/html, application/xhtml+xml\"\n }\n }\n\n get isSafe() {\n return isSafe(this.method)\n }\n\n get abortSignal() {\n return this.abortController.signal\n }\n\n acceptResponseType(mimeType) {\n this.headers[\"Accept\"] = [mimeType, this.headers[\"Accept\"]].join(\", \");\n }\n\n async #allowRequestToBeIntercepted(fetchOptions) {\n const requestInterception = new Promise((resolve) => (this.#resolveRequestPromise = resolve));\n const event = dispatch(\"turbo:before-fetch-request\", {\n cancelable: true,\n detail: {\n fetchOptions,\n url: this.url,\n resume: this.#resolveRequestPromise\n },\n target: this.target\n });\n this.url = event.detail.url;\n if (event.defaultPrevented) await requestInterception;\n\n return event\n }\n\n #willDelegateErrorHandling(error) {\n const event = dispatch(\"turbo:fetch-request-error\", {\n target: this.target,\n cancelable: true,\n detail: { request: this, error: error }\n });\n\n return !event.defaultPrevented\n }\n}\n\nfunction isSafe(fetchMethod) {\n return fetchMethodFromString(fetchMethod) == FetchMethod.get\n}\n\nfunction buildResourceAndBody(resource, method, requestBody, enctype) {\n const searchParams =\n Array.from(requestBody).length > 0 ? new URLSearchParams(entriesExcludingFiles(requestBody)) : resource.searchParams;\n\n if (isSafe(method)) {\n return [mergeIntoURLSearchParams(resource, searchParams), null]\n } else if (enctype == FetchEnctype.urlEncoded) {\n return [resource, searchParams]\n } else {\n return [resource, requestBody]\n }\n}\n\nfunction entriesExcludingFiles(requestBody) {\n const entries = [];\n\n for (const [name, value] of requestBody) {\n if (value instanceof File) continue\n else entries.push([name, value]);\n }\n\n return entries\n}\n\nfunction mergeIntoURLSearchParams(url, requestBody) {\n const searchParams = new URLSearchParams(entriesExcludingFiles(requestBody));\n\n url.search = searchParams.toString();\n\n return url\n}\n\nclass AppearanceObserver {\n started = false\n\n constructor(delegate, element) {\n this.delegate = delegate;\n this.element = element;\n this.intersectionObserver = new IntersectionObserver(this.intersect);\n }\n\n start() {\n if (!this.started) {\n this.started = true;\n this.intersectionObserver.observe(this.element);\n }\n }\n\n stop() {\n if (this.started) {\n this.started = false;\n this.intersectionObserver.unobserve(this.element);\n }\n }\n\n intersect = (entries) => {\n const lastEntry = entries.slice(-1)[0];\n if (lastEntry?.isIntersecting) {\n this.delegate.elementAppearedInViewport(this.element);\n }\n }\n}\n\nclass StreamMessage {\n static contentType = \"text/vnd.turbo-stream.html\"\n\n static wrap(message) {\n if (typeof message == \"string\") {\n return new this(createDocumentFragment(message))\n } else {\n return message\n }\n }\n\n constructor(fragment) {\n this.fragment = importStreamElements(fragment);\n }\n}\n\nfunction importStreamElements(fragment) {\n for (const element of fragment.querySelectorAll(\"turbo-stream\")) {\n const streamElement = document.importNode(element, true);\n\n for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll(\"script\")) {\n inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));\n }\n\n element.replaceWith(streamElement);\n }\n\n return fragment\n}\n\nconst PREFETCH_DELAY = 100;\n\nclass PrefetchCache {\n #prefetchTimeout = null\n #prefetched = null\n\n get(url) {\n if (this.#prefetched && this.#prefetched.url === url && this.#prefetched.expire > Date.now()) {\n return this.#prefetched.request\n }\n }\n\n setLater(url, request, ttl) {\n this.clear();\n\n this.#prefetchTimeout = setTimeout(() => {\n request.perform();\n this.set(url, request, ttl);\n this.#prefetchTimeout = null;\n }, PREFETCH_DELAY);\n }\n\n set(url, request, ttl) {\n this.#prefetched = { url, request, expire: new Date(new Date().getTime() + ttl) };\n }\n\n clear() {\n if (this.#prefetchTimeout) clearTimeout(this.#prefetchTimeout);\n this.#prefetched = null;\n }\n}\n\nconst cacheTtl = 10 * 1000;\nconst prefetchCache = new PrefetchCache();\n\nconst FormSubmissionState = {\n initialized: \"initialized\",\n requesting: \"requesting\",\n waiting: \"waiting\",\n receiving: \"receiving\",\n stopping: \"stopping\",\n stopped: \"stopped\"\n};\n\nclass FormSubmission {\n state = FormSubmissionState.initialized\n\n static confirmMethod(message) {\n return Promise.resolve(confirm(message))\n }\n\n constructor(delegate, formElement, submitter, mustRedirect = false) {\n const method = getMethod(formElement, submitter);\n const action = getAction(getFormAction(formElement, submitter), method);\n const body = buildFormData(formElement, submitter);\n const enctype = getEnctype(formElement, submitter);\n\n this.delegate = delegate;\n this.formElement = formElement;\n this.submitter = submitter;\n this.fetchRequest = new FetchRequest(this, method, action, body, formElement, enctype);\n this.mustRedirect = mustRedirect;\n }\n\n get method() {\n return this.fetchRequest.method\n }\n\n set method(value) {\n this.fetchRequest.method = value;\n }\n\n get action() {\n return this.fetchRequest.url.toString()\n }\n\n set action(value) {\n this.fetchRequest.url = expandURL(value);\n }\n\n get body() {\n return this.fetchRequest.body\n }\n\n get enctype() {\n return this.fetchRequest.enctype\n }\n\n get isSafe() {\n return this.fetchRequest.isSafe\n }\n\n get location() {\n return this.fetchRequest.url\n }\n\n // The submission process\n\n async start() {\n const { initialized, requesting } = FormSubmissionState;\n const confirmationMessage = getAttribute(\"data-turbo-confirm\", this.submitter, this.formElement);\n\n if (typeof confirmationMessage === \"string\") {\n const confirmMethod = typeof config.forms.confirm === \"function\" ?\n config.forms.confirm :\n FormSubmission.confirmMethod;\n\n const answer = await confirmMethod(confirmationMessage, this.formElement, this.submitter);\n if (!answer) {\n return\n }\n }\n\n if (this.state == initialized) {\n this.state = requesting;\n return this.fetchRequest.perform()\n }\n }\n\n stop() {\n const { stopping, stopped } = FormSubmissionState;\n if (this.state != stopping && this.state != stopped) {\n this.state = stopping;\n this.fetchRequest.cancel();\n return true\n }\n }\n\n // Fetch request delegate\n\n prepareRequest(request) {\n if (!request.isSafe) {\n const token = getCookieValue(getMetaContent(\"csrf-param\")) || getMetaContent(\"csrf-token\");\n if (token) {\n request.headers[\"X-CSRF-Token\"] = token;\n }\n }\n\n if (this.requestAcceptsTurboStreamResponse(request)) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n\n requestStarted(_request) {\n this.state = FormSubmissionState.waiting;\n if (this.submitter) config.forms.submitter.beforeSubmit(this.submitter);\n this.setSubmitsWith();\n markAsBusy(this.formElement);\n dispatch(\"turbo:submit-start\", {\n target: this.formElement,\n detail: { formSubmission: this }\n });\n this.delegate.formSubmissionStarted(this);\n }\n\n requestPreventedHandlingResponse(request, response) {\n prefetchCache.clear();\n\n this.result = { success: response.succeeded, fetchResponse: response };\n }\n\n requestSucceededWithResponse(request, response) {\n if (response.clientError || response.serverError) {\n this.delegate.formSubmissionFailedWithResponse(this, response);\n return\n }\n\n prefetchCache.clear();\n\n if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {\n const error = new Error(\"Form responses must redirect to another location\");\n this.delegate.formSubmissionErrored(this, error);\n } else {\n this.state = FormSubmissionState.receiving;\n this.result = { success: true, fetchResponse: response };\n this.delegate.formSubmissionSucceededWithResponse(this, response);\n }\n }\n\n requestFailedWithResponse(request, response) {\n this.result = { success: false, fetchResponse: response };\n this.delegate.formSubmissionFailedWithResponse(this, response);\n }\n\n requestErrored(request, error) {\n this.result = { success: false, error };\n this.delegate.formSubmissionErrored(this, error);\n }\n\n requestFinished(_request) {\n this.state = FormSubmissionState.stopped;\n if (this.submitter) config.forms.submitter.afterSubmit(this.submitter);\n this.resetSubmitterText();\n clearBusyState(this.formElement);\n dispatch(\"turbo:submit-end\", {\n target: this.formElement,\n detail: { formSubmission: this, ...this.result }\n });\n this.delegate.formSubmissionFinished(this);\n }\n\n // Private\n\n setSubmitsWith() {\n if (!this.submitter || !this.submitsWith) return\n\n if (this.submitter.matches(\"button\")) {\n this.originalSubmitText = this.submitter.innerHTML;\n this.submitter.innerHTML = this.submitsWith;\n } else if (this.submitter.matches(\"input\")) {\n const input = this.submitter;\n this.originalSubmitText = input.value;\n input.value = this.submitsWith;\n }\n }\n\n resetSubmitterText() {\n if (!this.submitter || !this.originalSubmitText) return\n\n if (this.submitter.matches(\"button\")) {\n this.submitter.innerHTML = this.originalSubmitText;\n } else if (this.submitter.matches(\"input\")) {\n const input = this.submitter;\n input.value = this.originalSubmitText;\n }\n }\n\n requestMustRedirect(request) {\n return !request.isSafe && this.mustRedirect\n }\n\n requestAcceptsTurboStreamResponse(request) {\n return !request.isSafe || hasAttribute(\"data-turbo-stream\", this.submitter, this.formElement)\n }\n\n get submitsWith() {\n return this.submitter?.getAttribute(\"data-turbo-submits-with\")\n }\n}\n\nfunction buildFormData(formElement, submitter) {\n const formData = new FormData(formElement);\n const name = submitter?.getAttribute(\"name\");\n const value = submitter?.getAttribute(\"value\");\n\n if (name) {\n formData.append(name, value || \"\");\n }\n\n return formData\n}\n\nfunction getCookieValue(cookieName) {\n if (cookieName != null) {\n const cookies = document.cookie ? document.cookie.split(\"; \") : [];\n const cookie = cookies.find((cookie) => cookie.startsWith(cookieName));\n if (cookie) {\n const value = cookie.split(\"=\").slice(1).join(\"=\");\n return value ? decodeURIComponent(value) : undefined\n }\n }\n}\n\nfunction responseSucceededWithoutRedirect(response) {\n return response.statusCode == 200 && !response.redirected\n}\n\nfunction getFormAction(formElement, submitter) {\n const formElementAction = typeof formElement.action === \"string\" ? formElement.action : null;\n\n if (submitter?.hasAttribute(\"formaction\")) {\n return submitter.getAttribute(\"formaction\") || \"\"\n } else {\n return formElement.getAttribute(\"action\") || formElementAction || \"\"\n }\n}\n\nfunction getAction(formAction, fetchMethod) {\n const action = expandURL(formAction);\n\n if (isSafe(fetchMethod)) {\n action.search = \"\";\n }\n\n return action\n}\n\nfunction getMethod(formElement, submitter) {\n const method = submitter?.getAttribute(\"formmethod\") || formElement.getAttribute(\"method\") || \"\";\n return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get\n}\n\nfunction getEnctype(formElement, submitter) {\n return fetchEnctypeFromString(submitter?.getAttribute(\"formenctype\") || formElement.enctype)\n}\n\nclass Snapshot {\n constructor(element) {\n this.element = element;\n }\n\n get activeElement() {\n return this.element.ownerDocument.activeElement\n }\n\n get children() {\n return [...this.element.children]\n }\n\n hasAnchor(anchor) {\n return this.getElementForAnchor(anchor) != null\n }\n\n getElementForAnchor(anchor) {\n return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null\n }\n\n get isConnected() {\n return this.element.isConnected\n }\n\n get firstAutofocusableElement() {\n return queryAutofocusableElement(this.element)\n }\n\n get permanentElements() {\n return queryPermanentElementsAll(this.element)\n }\n\n getPermanentElementById(id) {\n return getPermanentElementById(this.element, id)\n }\n\n getPermanentElementMapForSnapshot(snapshot) {\n const permanentElementMap = {};\n\n for (const currentPermanentElement of this.permanentElements) {\n const { id } = currentPermanentElement;\n const newPermanentElement = snapshot.getPermanentElementById(id);\n if (newPermanentElement) {\n permanentElementMap[id] = [currentPermanentElement, newPermanentElement];\n }\n }\n\n return permanentElementMap\n }\n}\n\nfunction getPermanentElementById(node, id) {\n return node.querySelector(`#${id}[data-turbo-permanent]`)\n}\n\nfunction queryPermanentElementsAll(node) {\n return node.querySelectorAll(\"[id][data-turbo-permanent]\")\n}\n\nclass FormSubmitObserver {\n started = false\n\n constructor(delegate, eventTarget) {\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"submit\", this.submitCaptured, true);\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"submit\", this.submitCaptured, true);\n this.started = false;\n }\n }\n\n submitCaptured = () => {\n this.eventTarget.removeEventListener(\"submit\", this.submitBubbled, false);\n this.eventTarget.addEventListener(\"submit\", this.submitBubbled, false);\n }\n\n submitBubbled = (event) => {\n if (!event.defaultPrevented) {\n const form = event.target instanceof HTMLFormElement ? event.target : undefined;\n const submitter = event.submitter || undefined;\n\n if (\n form &&\n submissionDoesNotDismissDialog(form, submitter) &&\n submissionDoesNotTargetIFrame(form, submitter) &&\n this.delegate.willSubmitForm(form, submitter)\n ) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.delegate.formSubmitted(form, submitter);\n }\n }\n }\n}\n\nfunction submissionDoesNotDismissDialog(form, submitter) {\n const method = submitter?.getAttribute(\"formmethod\") || form.getAttribute(\"method\");\n\n return method != \"dialog\"\n}\n\nfunction submissionDoesNotTargetIFrame(form, submitter) {\n const target = submitter?.getAttribute(\"formtarget\") || form.getAttribute(\"target\");\n\n return doesNotTargetIFrame(target)\n}\n\nclass View {\n #resolveRenderPromise = (_value) => {}\n #resolveInterceptionPromise = (_value) => {}\n\n constructor(delegate, element) {\n this.delegate = delegate;\n this.element = element;\n }\n\n // Scrolling\n\n scrollToAnchor(anchor) {\n const element = this.snapshot.getElementForAnchor(anchor);\n if (element) {\n this.scrollToElement(element);\n this.focusElement(element);\n } else {\n this.scrollToPosition({ x: 0, y: 0 });\n }\n }\n\n scrollToAnchorFromLocation(location) {\n this.scrollToAnchor(getAnchor(location));\n }\n\n scrollToElement(element) {\n element.scrollIntoView();\n }\n\n focusElement(element) {\n if (element instanceof HTMLElement) {\n if (element.hasAttribute(\"tabindex\")) {\n element.focus();\n } else {\n element.setAttribute(\"tabindex\", \"-1\");\n element.focus();\n element.removeAttribute(\"tabindex\");\n }\n }\n }\n\n scrollToPosition({ x, y }) {\n this.scrollRoot.scrollTo(x, y);\n }\n\n scrollToTop() {\n this.scrollToPosition({ x: 0, y: 0 });\n }\n\n get scrollRoot() {\n return window\n }\n\n // Rendering\n\n async render(renderer) {\n const { isPreview, shouldRender, willRender, newSnapshot: snapshot } = renderer;\n\n // A workaround to ignore tracked element mismatch reloads when performing\n // a promoted Visit from a frame navigation\n const shouldInvalidate = willRender;\n\n if (shouldRender) {\n try {\n this.renderPromise = new Promise((resolve) => (this.#resolveRenderPromise = resolve));\n this.renderer = renderer;\n await this.prepareToRenderSnapshot(renderer);\n\n const renderInterception = new Promise((resolve) => (this.#resolveInterceptionPromise = resolve));\n const options = { resume: this.#resolveInterceptionPromise, render: this.renderer.renderElement, renderMethod: this.renderer.renderMethod };\n const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);\n if (!immediateRender) await renderInterception;\n\n await this.renderSnapshot(renderer);\n this.delegate.viewRenderedSnapshot(snapshot, isPreview, this.renderer.renderMethod);\n this.delegate.preloadOnLoadLinksForView(this.element);\n this.finishRenderingSnapshot(renderer);\n } finally {\n delete this.renderer;\n this.#resolveRenderPromise(undefined);\n delete this.renderPromise;\n }\n } else if (shouldInvalidate) {\n this.invalidate(renderer.reloadReason);\n }\n }\n\n invalidate(reason) {\n this.delegate.viewInvalidated(reason);\n }\n\n async prepareToRenderSnapshot(renderer) {\n this.markAsPreview(renderer.isPreview);\n await renderer.prepareToRender();\n }\n\n markAsPreview(isPreview) {\n if (isPreview) {\n this.element.setAttribute(\"data-turbo-preview\", \"\");\n } else {\n this.element.removeAttribute(\"data-turbo-preview\");\n }\n }\n\n markVisitDirection(direction) {\n this.element.setAttribute(\"data-turbo-visit-direction\", direction);\n }\n\n unmarkVisitDirection() {\n this.element.removeAttribute(\"data-turbo-visit-direction\");\n }\n\n async renderSnapshot(renderer) {\n await renderer.render();\n }\n\n finishRenderingSnapshot(renderer) {\n renderer.finishRendering();\n }\n}\n\nclass FrameView extends View {\n missing() {\n this.element.innerHTML = `<strong class=\"turbo-frame-error\">Content missing</strong>`;\n }\n\n get snapshot() {\n return new Snapshot(this.element)\n }\n}\n\nclass LinkInterceptor {\n constructor(delegate, element) {\n this.delegate = delegate;\n this.element = element;\n }\n\n start() {\n this.element.addEventListener(\"click\", this.clickBubbled);\n document.addEventListener(\"turbo:click\", this.linkClicked);\n document.addEventListener(\"turbo:before-visit\", this.willVisit);\n }\n\n stop() {\n this.element.removeEventListener(\"click\", this.clickBubbled);\n document.removeEventListener(\"turbo:click\", this.linkClicked);\n document.removeEventListener(\"turbo:before-visit\", this.willVisit);\n }\n\n clickBubbled = (event) => {\n if (this.clickEventIsSignificant(event)) {\n this.clickEvent = event;\n } else {\n delete this.clickEvent;\n }\n }\n\n linkClicked = (event) => {\n if (this.clickEvent && this.clickEventIsSignificant(event)) {\n if (this.delegate.shouldInterceptLinkClick(event.target, event.detail.url, event.detail.originalEvent)) {\n this.clickEvent.preventDefault();\n event.preventDefault();\n this.delegate.linkClickIntercepted(event.target, event.detail.url, event.detail.originalEvent);\n }\n }\n delete this.clickEvent;\n }\n\n willVisit = (_event) => {\n delete this.clickEvent;\n }\n\n clickEventIsSignificant(event) {\n const target = event.composed ? event.target?.parentElement : event.target;\n const element = findLinkFromClickTarget(target) || target;\n\n return element instanceof Element && element.closest(\"turbo-frame, html\") == this.element\n }\n}\n\nclass LinkClickObserver {\n started = false\n\n constructor(delegate, eventTarget) {\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"click\", this.clickCaptured, true);\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"click\", this.clickCaptured, true);\n this.started = false;\n }\n }\n\n clickCaptured = () => {\n this.eventTarget.removeEventListener(\"click\", this.clickBubbled, false);\n this.eventTarget.addEventListener(\"click\", this.clickBubbled, false);\n }\n\n clickBubbled = (event) => {\n if (event instanceof MouseEvent && this.clickEventIsSignificant(event)) {\n const target = (event.composedPath && event.composedPath()[0]) || event.target;\n const link = findLinkFromClickTarget(target);\n if (link && doesNotTargetIFrame(link.target)) {\n const location = getLocationForLink(link);\n if (this.delegate.willFollowLinkToLocation(link, location, event)) {\n event.preventDefault();\n this.delegate.followedLinkToLocation(link, location);\n }\n }\n }\n }\n\n clickEventIsSignificant(event) {\n return !(\n (event.target && event.target.isContentEditable) ||\n event.defaultPrevented ||\n event.which > 1 ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n )\n }\n}\n\nclass FormLinkClickObserver {\n constructor(delegate, element) {\n this.delegate = delegate;\n this.linkInterceptor = new LinkClickObserver(this, element);\n }\n\n start() {\n this.linkInterceptor.start();\n }\n\n stop() {\n this.linkInterceptor.stop();\n }\n\n // Link hover observer delegate\n\n canPrefetchRequestToLocation(link, location) {\n return false\n }\n\n prefetchAndCacheRequestToLocation(link, location) {\n return\n }\n\n // Link click observer delegate\n\n willFollowLinkToLocation(link, location, originalEvent) {\n return (\n this.delegate.willSubmitFormLinkToLocation(link, location, originalEvent) &&\n (link.hasAttribute(\"data-turbo-method\") || link.hasAttribute(\"data-turbo-stream\"))\n )\n }\n\n followedLinkToLocation(link, location) {\n const form = document.createElement(\"form\");\n\n const type = \"hidden\";\n for (const [name, value] of location.searchParams) {\n form.append(Object.assign(document.createElement(\"input\"), { type, name, value }));\n }\n\n const action = Object.assign(location, { search: \"\" });\n form.setAttribute(\"data-turbo\", \"true\");\n form.setAttribute(\"action\", action.href);\n form.setAttribute(\"hidden\", \"\");\n\n const method = link.getAttribute(\"data-turbo-method\");\n if (method) form.setAttribute(\"method\", method);\n\n const turboFrame = link.getAttribute(\"data-turbo-frame\");\n if (turboFrame) form.setAttribute(\"data-turbo-frame\", turboFrame);\n\n const turboAction = getVisitAction(link);\n if (turboAction) form.setAttribute(\"data-turbo-action\", turboAction);\n\n const turboConfirm = link.getAttribute(\"data-turbo-confirm\");\n if (turboConfirm) form.setAttribute(\"data-turbo-confirm\", turboConfirm);\n\n const turboStream = link.hasAttribute(\"data-turbo-stream\");\n if (turboStream) form.setAttribute(\"data-turbo-stream\", \"\");\n\n this.delegate.submittedFormLinkToLocation(link, location, form);\n\n document.body.appendChild(form);\n form.addEventListener(\"turbo:submit-end\", () => form.remove(), { once: true });\n requestAnimationFrame(() => form.requestSubmit());\n }\n}\n\nclass Bardo {\n static async preservingPermanentElements(delegate, permanentElementMap, callback) {\n const bardo = new this(delegate, permanentElementMap);\n bardo.enter();\n await callback();\n bardo.leave();\n }\n\n constructor(delegate, permanentElementMap) {\n this.delegate = delegate;\n this.permanentElementMap = permanentElementMap;\n }\n\n enter() {\n for (const id in this.permanentElementMap) {\n const [currentPermanentElement, newPermanentElement] = this.permanentElementMap[id];\n this.delegate.enteringBardo(currentPermanentElement, newPermanentElement);\n this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);\n }\n }\n\n leave() {\n for (const id in this.permanentElementMap) {\n const [currentPermanentElement] = this.permanentElementMap[id];\n this.replaceCurrentPermanentElementWithClone(currentPermanentElement);\n this.replacePlaceholderWithPermanentElement(currentPermanentElement);\n this.delegate.leavingBardo(currentPermanentElement);\n }\n }\n\n replaceNewPermanentElementWithPlaceholder(permanentElement) {\n const placeholder = createPlaceholderForPermanentElement(permanentElement);\n permanentElement.replaceWith(placeholder);\n }\n\n replaceCurrentPermanentElementWithClone(permanentElement) {\n const clone = permanentElement.cloneNode(true);\n permanentElement.replaceWith(clone);\n }\n\n replacePlaceholderWithPermanentElement(permanentElement) {\n const placeholder = this.getPlaceholderById(permanentElement.id);\n placeholder?.replaceWith(permanentElement);\n }\n\n getPlaceholderById(id) {\n return this.placeholders.find((element) => element.content == id)\n }\n\n get placeholders() {\n return [...document.querySelectorAll(\"meta[name=turbo-permanent-placeholder][content]\")]\n }\n}\n\nfunction createPlaceholderForPermanentElement(permanentElement) {\n const element = document.createElement(\"meta\");\n element.setAttribute(\"name\", \"turbo-permanent-placeholder\");\n element.setAttribute(\"content\", permanentElement.id);\n return element\n}\n\nclass Renderer {\n #activeElement = null\n\n static renderElement(currentElement, newElement) {\n // Abstract method\n }\n\n constructor(currentSnapshot, newSnapshot, isPreview, willRender = true) {\n this.currentSnapshot = currentSnapshot;\n this.newSnapshot = newSnapshot;\n this.isPreview = isPreview;\n this.willRender = willRender;\n this.renderElement = this.constructor.renderElement;\n this.promise = new Promise((resolve, reject) => (this.resolvingFunctions = { resolve, reject }));\n }\n\n get shouldRender() {\n return true\n }\n\n get shouldAutofocus() {\n return true\n }\n\n get reloadReason() {\n return\n }\n\n prepareToRender() {\n return\n }\n\n render() {\n // Abstract method\n }\n\n finishRendering() {\n if (this.resolvingFunctions) {\n this.resolvingFunctions.resolve();\n delete this.resolvingFunctions;\n }\n }\n\n async preservingPermanentElements(callback) {\n await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback);\n }\n\n focusFirstAutofocusableElement() {\n if (this.shouldAutofocus) {\n const element = this.connectedSnapshot.firstAutofocusableElement;\n if (element) {\n element.focus();\n }\n }\n }\n\n // Bardo delegate\n\n enteringBardo(currentPermanentElement) {\n if (this.#activeElement) return\n\n if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {\n this.#activeElement = this.currentSnapshot.activeElement;\n }\n }\n\n leavingBardo(currentPermanentElement) {\n if (currentPermanentElement.contains(this.#activeElement) && this.#activeElement instanceof HTMLElement) {\n this.#activeElement.focus();\n\n this.#activeElement = null;\n }\n }\n\n get connectedSnapshot() {\n return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot\n }\n\n get currentElement() {\n return this.currentSnapshot.element\n }\n\n get newElement() {\n return this.newSnapshot.element\n }\n\n get permanentElementMap() {\n return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)\n }\n\n get renderMethod() {\n return \"replace\"\n }\n}\n\nclass FrameRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n const destinationRange = document.createRange();\n destinationRange.selectNodeContents(currentElement);\n destinationRange.deleteContents();\n\n const frameElement = newElement;\n const sourceRange = frameElement.ownerDocument?.createRange();\n if (sourceRange) {\n sourceRange.selectNodeContents(frameElement);\n currentElement.appendChild(sourceRange.extractContents());\n }\n }\n\n constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {\n super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);\n this.delegate = delegate;\n }\n\n get shouldRender() {\n return true\n }\n\n async render() {\n await nextRepaint();\n this.preservingPermanentElements(() => {\n this.loadFrameElement();\n });\n this.scrollFrameIntoView();\n await nextRepaint();\n this.focusFirstAutofocusableElement();\n await nextRepaint();\n this.activateScriptElements();\n }\n\n loadFrameElement() {\n this.delegate.willRenderFrame(this.currentElement, this.newElement);\n this.renderElement(this.currentElement, this.newElement);\n }\n\n scrollFrameIntoView() {\n if (this.currentElement.autoscroll || this.newElement.autoscroll) {\n const element = this.currentElement.firstElementChild;\n const block = readScrollLogicalPosition(this.currentElement.getAttribute(\"data-autoscroll-block\"), \"end\");\n const behavior = readScrollBehavior(this.currentElement.getAttribute(\"data-autoscroll-behavior\"), \"auto\");\n\n if (element) {\n element.scrollIntoView({ block, behavior });\n return true\n }\n }\n return false\n }\n\n activateScriptElements() {\n for (const inertScriptElement of this.newScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n\n get newScriptElements() {\n return this.currentElement.querySelectorAll(\"script\")\n }\n}\n\nfunction readScrollLogicalPosition(value, defaultValue) {\n if (value == \"end\" || value == \"start\" || value == \"center\" || value == \"nearest\") {\n return value\n } else {\n return defaultValue\n }\n}\n\nfunction readScrollBehavior(value, defaultValue) {\n if (value == \"auto\" || value == \"smooth\") {\n return value\n } else {\n return defaultValue\n }\n}\n\n// base IIFE to define idiomorph\nvar Idiomorph = (function () {\n\n //=============================================================================\n // AND NOW IT BEGINS...\n //=============================================================================\n let EMPTY_SET = new Set();\n\n // default configuration values, updatable by users now\n let defaults = {\n morphStyle: \"outerHTML\",\n callbacks : {\n beforeNodeAdded: noOp,\n afterNodeAdded: noOp,\n beforeNodeMorphed: noOp,\n afterNodeMorphed: noOp,\n beforeNodeRemoved: noOp,\n afterNodeRemoved: noOp,\n beforeAttributeUpdated: noOp,\n\n },\n head: {\n style: 'merge',\n shouldPreserve: function (elt) {\n return elt.getAttribute(\"im-preserve\") === \"true\";\n },\n shouldReAppend: function (elt) {\n return elt.getAttribute(\"im-re-append\") === \"true\";\n },\n shouldRemove: noOp,\n afterHeadMorphed: noOp,\n }\n };\n\n //=============================================================================\n // Core Morphing Algorithm - morph, morphNormalizedContent, morphOldNodeTo, morphChildren\n //=============================================================================\n function morph(oldNode, newContent, config = {}) {\n\n if (oldNode instanceof Document) {\n oldNode = oldNode.documentElement;\n }\n\n if (typeof newContent === 'string') {\n newContent = parseContent(newContent);\n }\n\n let normalizedContent = normalizeContent(newContent);\n\n let ctx = createMorphContext(oldNode, normalizedContent, config);\n\n return morphNormalizedContent(oldNode, normalizedContent, ctx);\n }\n\n function morphNormalizedContent(oldNode, normalizedNewContent, ctx) {\n if (ctx.head.block) {\n let oldHead = oldNode.querySelector('head');\n let newHead = normalizedNewContent.querySelector('head');\n if (oldHead && newHead) {\n let promises = handleHeadElement(newHead, oldHead, ctx);\n // when head promises resolve, call morph again, ignoring the head tag\n Promise.all(promises).then(function () {\n morphNormalizedContent(oldNode, normalizedNewContent, Object.assign(ctx, {\n head: {\n block: false,\n ignore: true\n }\n }));\n });\n return;\n }\n }\n\n if (ctx.morphStyle === \"innerHTML\") {\n\n // innerHTML, so we are only updating the children\n morphChildren(normalizedNewContent, oldNode, ctx);\n return oldNode.children;\n\n } else if (ctx.morphStyle === \"outerHTML\" || ctx.morphStyle == null) {\n // otherwise find the best element match in the new content, morph that, and merge its siblings\n // into either side of the best match\n let bestMatch = findBestNodeMatch(normalizedNewContent, oldNode, ctx);\n\n // stash the siblings that will need to be inserted on either side of the best match\n let previousSibling = bestMatch?.previousSibling;\n let nextSibling = bestMatch?.nextSibling;\n\n // morph it\n let morphedNode = morphOldNodeTo(oldNode, bestMatch, ctx);\n\n if (bestMatch) {\n // if there was a best match, merge the siblings in too and return the\n // whole bunch\n return insertSiblings(previousSibling, morphedNode, nextSibling);\n } else {\n // otherwise nothing was added to the DOM\n return []\n }\n } else {\n throw \"Do not understand how to morph style \" + ctx.morphStyle;\n }\n }\n\n\n /**\n * @param possibleActiveElement\n * @param ctx\n * @returns {boolean}\n */\n function ignoreValueOfActiveElement(possibleActiveElement, ctx) {\n return ctx.ignoreActiveValue && possibleActiveElement === document.activeElement && possibleActiveElement !== document.body;\n }\n\n /**\n * @param oldNode root node to merge content into\n * @param newContent new content to merge\n * @param ctx the merge context\n * @returns {Element} the element that ended up in the DOM\n */\n function morphOldNodeTo(oldNode, newContent, ctx) {\n if (ctx.ignoreActive && oldNode === document.activeElement) ; else if (newContent == null) {\n if (ctx.callbacks.beforeNodeRemoved(oldNode) === false) return oldNode;\n\n oldNode.remove();\n ctx.callbacks.afterNodeRemoved(oldNode);\n return null;\n } else if (!isSoftMatch(oldNode, newContent)) {\n if (ctx.callbacks.beforeNodeRemoved(oldNode) === false) return oldNode;\n if (ctx.callbacks.beforeNodeAdded(newContent) === false) return oldNode;\n\n oldNode.parentElement.replaceChild(newContent, oldNode);\n ctx.callbacks.afterNodeAdded(newContent);\n ctx.callbacks.afterNodeRemoved(oldNode);\n return newContent;\n } else {\n if (ctx.callbacks.beforeNodeMorphed(oldNode, newContent) === false) return oldNode;\n\n if (oldNode instanceof HTMLHeadElement && ctx.head.ignore) ; else if (oldNode instanceof HTMLHeadElement && ctx.head.style !== \"morph\") {\n handleHeadElement(newContent, oldNode, ctx);\n } else {\n syncNodeFrom(newContent, oldNode, ctx);\n if (!ignoreValueOfActiveElement(oldNode, ctx)) {\n morphChildren(newContent, oldNode, ctx);\n }\n }\n ctx.callbacks.afterNodeMorphed(oldNode, newContent);\n return oldNode;\n }\n }\n\n /**\n * This is the core algorithm for matching up children. The idea is to use id sets to try to match up\n * nodes as faithfully as possible. We greedily match, which allows us to keep the algorithm fast, but\n * by using id sets, we are able to better match up with content deeper in the DOM.\n *\n * Basic algorithm is, for each node in the new content:\n *\n * - if we have reached the end of the old parent, append the new content\n * - if the new content has an id set match with the current insertion point, morph\n * - search for an id set match\n * - if id set match found, morph\n * - otherwise search for a \"soft\" match\n * - if a soft match is found, morph\n * - otherwise, prepend the new node before the current insertion point\n *\n * The two search algorithms terminate if competing node matches appear to outweigh what can be achieved\n * with the current node. See findIdSetMatch() and findSoftMatch() for details.\n *\n * @param {Element} newParent the parent element of the new content\n * @param {Element } oldParent the old content that we are merging the new content into\n * @param ctx the merge context\n */\n function morphChildren(newParent, oldParent, ctx) {\n\n let nextNewChild = newParent.firstChild;\n let insertionPoint = oldParent.firstChild;\n let newChild;\n\n // run through all the new content\n while (nextNewChild) {\n\n newChild = nextNewChild;\n nextNewChild = newChild.nextSibling;\n\n // if we are at the end of the exiting parent's children, just append\n if (insertionPoint == null) {\n if (ctx.callbacks.beforeNodeAdded(newChild) === false) return;\n\n oldParent.appendChild(newChild);\n ctx.callbacks.afterNodeAdded(newChild);\n removeIdsFromConsideration(ctx, newChild);\n continue;\n }\n\n // if the current node has an id set match then morph\n if (isIdSetMatch(newChild, insertionPoint, ctx)) {\n morphOldNodeTo(insertionPoint, newChild, ctx);\n insertionPoint = insertionPoint.nextSibling;\n removeIdsFromConsideration(ctx, newChild);\n continue;\n }\n\n // otherwise search forward in the existing old children for an id set match\n let idSetMatch = findIdSetMatch(newParent, oldParent, newChild, insertionPoint, ctx);\n\n // if we found a potential match, remove the nodes until that point and morph\n if (idSetMatch) {\n insertionPoint = removeNodesBetween(insertionPoint, idSetMatch, ctx);\n morphOldNodeTo(idSetMatch, newChild, ctx);\n removeIdsFromConsideration(ctx, newChild);\n continue;\n }\n\n // no id set match found, so scan forward for a soft match for the current node\n let softMatch = findSoftMatch(newParent, oldParent, newChild, insertionPoint, ctx);\n\n // if we found a soft match for the current node, morph\n if (softMatch) {\n insertionPoint = removeNodesBetween(insertionPoint, softMatch, ctx);\n morphOldNodeTo(softMatch, newChild, ctx);\n removeIdsFromConsideration(ctx, newChild);\n continue;\n }\n\n // abandon all hope of morphing, just insert the new child before the insertion point\n // and move on\n if (ctx.callbacks.beforeNodeAdded(newChild) === false) return;\n\n oldParent.insertBefore(newChild, insertionPoint);\n ctx.callbacks.afterNodeAdded(newChild);\n removeIdsFromConsideration(ctx, newChild);\n }\n\n // remove any remaining old nodes that didn't match up with new content\n while (insertionPoint !== null) {\n\n let tempNode = insertionPoint;\n insertionPoint = insertionPoint.nextSibling;\n removeNode(tempNode, ctx);\n }\n }\n\n //=============================================================================\n // Attribute Syncing Code\n //=============================================================================\n\n /**\n * @param attr {String} the attribute to be mutated\n * @param to {Element} the element that is going to be updated\n * @param updateType {(\"update\"|\"remove\")}\n * @param ctx the merge context\n * @returns {boolean} true if the attribute should be ignored, false otherwise\n */\n function ignoreAttribute(attr, to, updateType, ctx) {\n if(attr === 'value' && ctx.ignoreActiveValue && to === document.activeElement){\n return true;\n }\n return ctx.callbacks.beforeAttributeUpdated(attr, to, updateType) === false;\n }\n\n /**\n * syncs a given node with another node, copying over all attributes and\n * inner element state from the 'from' node to the 'to' node\n *\n * @param {Element} from the element to copy attributes & state from\n * @param {Element} to the element to copy attributes & state to\n * @param ctx the merge context\n */\n function syncNodeFrom(from, to, ctx) {\n let type = from.nodeType;\n\n // if is an element type, sync the attributes from the\n // new node into the new node\n if (type === 1 /* element type */) {\n const fromAttributes = from.attributes;\n const toAttributes = to.attributes;\n for (const fromAttribute of fromAttributes) {\n if (ignoreAttribute(fromAttribute.name, to, 'update', ctx)) {\n continue;\n }\n if (to.getAttribute(fromAttribute.name) !== fromAttribute.value) {\n to.setAttribute(fromAttribute.name, fromAttribute.value);\n }\n }\n // iterate backwards to avoid skipping over items when a delete occurs\n for (let i = toAttributes.length - 1; 0 <= i; i--) {\n const toAttribute = toAttributes[i];\n if (ignoreAttribute(toAttribute.name, to, 'remove', ctx)) {\n continue;\n }\n if (!from.hasAttribute(toAttribute.name)) {\n to.removeAttribute(toAttribute.name);\n }\n }\n }\n\n // sync text nodes\n if (type === 8 /* comment */ || type === 3 /* text */) {\n if (to.nodeValue !== from.nodeValue) {\n to.nodeValue = from.nodeValue;\n }\n }\n\n if (!ignoreValueOfActiveElement(to, ctx)) {\n // sync input values\n syncInputValue(from, to, ctx);\n }\n }\n\n /**\n * @param from {Element} element to sync the value from\n * @param to {Element} element to sync the value to\n * @param attributeName {String} the attribute name\n * @param ctx the merge context\n */\n function syncBooleanAttribute(from, to, attributeName, ctx) {\n if (from[attributeName] !== to[attributeName]) {\n let ignoreUpdate = ignoreAttribute(attributeName, to, 'update', ctx);\n if (!ignoreUpdate) {\n to[attributeName] = from[attributeName];\n }\n if (from[attributeName]) {\n if (!ignoreUpdate) {\n to.setAttribute(attributeName, from[attributeName]);\n }\n } else {\n if (!ignoreAttribute(attributeName, to, 'remove', ctx)) {\n to.removeAttribute(attributeName);\n }\n }\n }\n }\n\n /**\n * NB: many bothans died to bring us information:\n *\n * https://github.com/patrick-steele-idem/morphdom/blob/master/src/specialElHandlers.js\n * https://github.com/choojs/nanomorph/blob/master/lib/morph.jsL113\n *\n * @param from {Element} the element to sync the input value from\n * @param to {Element} the element to sync the input value to\n * @param ctx the merge context\n */\n function syncInputValue(from, to, ctx) {\n if (from instanceof HTMLInputElement &&\n to instanceof HTMLInputElement &&\n from.type !== 'file') {\n\n let fromValue = from.value;\n let toValue = to.value;\n\n // sync boolean attributes\n syncBooleanAttribute(from, to, 'checked', ctx);\n syncBooleanAttribute(from, to, 'disabled', ctx);\n\n if (!from.hasAttribute('value')) {\n if (!ignoreAttribute('value', to, 'remove', ctx)) {\n to.value = '';\n to.removeAttribute('value');\n }\n } else if (fromValue !== toValue) {\n if (!ignoreAttribute('value', to, 'update', ctx)) {\n to.setAttribute('value', fromValue);\n to.value = fromValue;\n }\n }\n } else if (from instanceof HTMLOptionElement) {\n syncBooleanAttribute(from, to, 'selected', ctx);\n } else if (from instanceof HTMLTextAreaElement && to instanceof HTMLTextAreaElement) {\n let fromValue = from.value;\n let toValue = to.value;\n if (ignoreAttribute('value', to, 'update', ctx)) {\n return;\n }\n if (fromValue !== toValue) {\n to.value = fromValue;\n }\n if (to.firstChild && to.firstChild.nodeValue !== fromValue) {\n to.firstChild.nodeValue = fromValue;\n }\n }\n }\n\n //=============================================================================\n // the HEAD tag can be handled specially, either w/ a 'merge' or 'append' style\n //=============================================================================\n function handleHeadElement(newHeadTag, currentHead, ctx) {\n\n let added = [];\n let removed = [];\n let preserved = [];\n let nodesToAppend = [];\n\n let headMergeStyle = ctx.head.style;\n\n // put all new head elements into a Map, by their outerHTML\n let srcToNewHeadNodes = new Map();\n for (const newHeadChild of newHeadTag.children) {\n srcToNewHeadNodes.set(newHeadChild.outerHTML, newHeadChild);\n }\n\n // for each elt in the current head\n for (const currentHeadElt of currentHead.children) {\n\n // If the current head element is in the map\n let inNewContent = srcToNewHeadNodes.has(currentHeadElt.outerHTML);\n let isReAppended = ctx.head.shouldReAppend(currentHeadElt);\n let isPreserved = ctx.head.shouldPreserve(currentHeadElt);\n if (inNewContent || isPreserved) {\n if (isReAppended) {\n // remove the current version and let the new version replace it and re-execute\n removed.push(currentHeadElt);\n } else {\n // this element already exists and should not be re-appended, so remove it from\n // the new content map, preserving it in the DOM\n srcToNewHeadNodes.delete(currentHeadElt.outerHTML);\n preserved.push(currentHeadElt);\n }\n } else {\n if (headMergeStyle === \"append\") {\n // we are appending and this existing element is not new content\n // so if and only if it is marked for re-append do we do anything\n if (isReAppended) {\n removed.push(currentHeadElt);\n nodesToAppend.push(currentHeadElt);\n }\n } else {\n // if this is a merge, we remove this content since it is not in the new head\n if (ctx.head.shouldRemove(currentHeadElt) !== false) {\n removed.push(currentHeadElt);\n }\n }\n }\n }\n\n // Push the remaining new head elements in the Map into the\n // nodes to append to the head tag\n nodesToAppend.push(...srcToNewHeadNodes.values());\n\n let promises = [];\n for (const newNode of nodesToAppend) {\n let newElt = document.createRange().createContextualFragment(newNode.outerHTML).firstChild;\n if (ctx.callbacks.beforeNodeAdded(newElt) !== false) {\n if (newElt.href || newElt.src) {\n let resolve = null;\n let promise = new Promise(function (_resolve) {\n resolve = _resolve;\n });\n newElt.addEventListener('load', function () {\n resolve();\n });\n promises.push(promise);\n }\n currentHead.appendChild(newElt);\n ctx.callbacks.afterNodeAdded(newElt);\n added.push(newElt);\n }\n }\n\n // remove all removed elements, after we have appended the new elements to avoid\n // additional network requests for things like style sheets\n for (const removedElement of removed) {\n if (ctx.callbacks.beforeNodeRemoved(removedElement) !== false) {\n currentHead.removeChild(removedElement);\n ctx.callbacks.afterNodeRemoved(removedElement);\n }\n }\n\n ctx.head.afterHeadMorphed(currentHead, {added: added, kept: preserved, removed: removed});\n return promises;\n }\n\n function noOp() {\n }\n\n /*\n Deep merges the config object and the Idiomoroph.defaults object to\n produce a final configuration object\n */\n function mergeDefaults(config) {\n let finalConfig = {};\n // copy top level stuff into final config\n Object.assign(finalConfig, defaults);\n Object.assign(finalConfig, config);\n\n // copy callbacks into final config (do this to deep merge the callbacks)\n finalConfig.callbacks = {};\n Object.assign(finalConfig.callbacks, defaults.callbacks);\n Object.assign(finalConfig.callbacks, config.callbacks);\n\n // copy head config into final config (do this to deep merge the head)\n finalConfig.head = {};\n Object.assign(finalConfig.head, defaults.head);\n Object.assign(finalConfig.head, config.head);\n return finalConfig;\n }\n\n function createMorphContext(oldNode, newContent, config) {\n config = mergeDefaults(config);\n return {\n target: oldNode,\n newContent: newContent,\n config: config,\n morphStyle: config.morphStyle,\n ignoreActive: config.ignoreActive,\n ignoreActiveValue: config.ignoreActiveValue,\n idMap: createIdMap(oldNode, newContent),\n deadIds: new Set(),\n callbacks: config.callbacks,\n head: config.head\n }\n }\n\n function isIdSetMatch(node1, node2, ctx) {\n if (node1 == null || node2 == null) {\n return false;\n }\n if (node1.nodeType === node2.nodeType && node1.tagName === node2.tagName) {\n if (node1.id !== \"\" && node1.id === node2.id) {\n return true;\n } else {\n return getIdIntersectionCount(ctx, node1, node2) > 0;\n }\n }\n return false;\n }\n\n function isSoftMatch(node1, node2) {\n if (node1 == null || node2 == null) {\n return false;\n }\n return node1.nodeType === node2.nodeType && node1.tagName === node2.tagName\n }\n\n function removeNodesBetween(startInclusive, endExclusive, ctx) {\n while (startInclusive !== endExclusive) {\n let tempNode = startInclusive;\n startInclusive = startInclusive.nextSibling;\n removeNode(tempNode, ctx);\n }\n removeIdsFromConsideration(ctx, endExclusive);\n return endExclusive.nextSibling;\n }\n\n //=============================================================================\n // Scans forward from the insertionPoint in the old parent looking for a potential id match\n // for the newChild. We stop if we find a potential id match for the new child OR\n // if the number of potential id matches we are discarding is greater than the\n // potential id matches for the new child\n //=============================================================================\n function findIdSetMatch(newContent, oldParent, newChild, insertionPoint, ctx) {\n\n // max id matches we are willing to discard in our search\n let newChildPotentialIdCount = getIdIntersectionCount(ctx, newChild, oldParent);\n\n let potentialMatch = null;\n\n // only search forward if there is a possibility of an id match\n if (newChildPotentialIdCount > 0) {\n let potentialMatch = insertionPoint;\n // if there is a possibility of an id match, scan forward\n // keep track of the potential id match count we are discarding (the\n // newChildPotentialIdCount must be greater than this to make it likely\n // worth it)\n let otherMatchCount = 0;\n while (potentialMatch != null) {\n\n // If we have an id match, return the current potential match\n if (isIdSetMatch(newChild, potentialMatch, ctx)) {\n return potentialMatch;\n }\n\n // computer the other potential matches of this new content\n otherMatchCount += getIdIntersectionCount(ctx, potentialMatch, newContent);\n if (otherMatchCount > newChildPotentialIdCount) {\n // if we have more potential id matches in _other_ content, we\n // do not have a good candidate for an id match, so return null\n return null;\n }\n\n // advanced to the next old content child\n potentialMatch = potentialMatch.nextSibling;\n }\n }\n return potentialMatch;\n }\n\n //=============================================================================\n // Scans forward from the insertionPoint in the old parent looking for a potential soft match\n // for the newChild. We stop if we find a potential soft match for the new child OR\n // if we find a potential id match in the old parents children OR if we find two\n // potential soft matches for the next two pieces of new content\n //=============================================================================\n function findSoftMatch(newContent, oldParent, newChild, insertionPoint, ctx) {\n\n let potentialSoftMatch = insertionPoint;\n let nextSibling = newChild.nextSibling;\n let siblingSoftMatchCount = 0;\n\n while (potentialSoftMatch != null) {\n\n if (getIdIntersectionCount(ctx, potentialSoftMatch, newContent) > 0) {\n // the current potential soft match has a potential id set match with the remaining new\n // content so bail out of looking\n return null;\n }\n\n // if we have a soft match with the current node, return it\n if (isSoftMatch(newChild, potentialSoftMatch)) {\n return potentialSoftMatch;\n }\n\n if (isSoftMatch(nextSibling, potentialSoftMatch)) {\n // the next new node has a soft match with this node, so\n // increment the count of future soft matches\n siblingSoftMatchCount++;\n nextSibling = nextSibling.nextSibling;\n\n // If there are two future soft matches, bail to allow the siblings to soft match\n // so that we don't consume future soft matches for the sake of the current node\n if (siblingSoftMatchCount >= 2) {\n return null;\n }\n }\n\n // advanced to the next old content child\n potentialSoftMatch = potentialSoftMatch.nextSibling;\n }\n\n return potentialSoftMatch;\n }\n\n function parseContent(newContent) {\n let parser = new DOMParser();\n\n // remove svgs to avoid false-positive matches on head, etc.\n let contentWithSvgsRemoved = newContent.replace(/<svg(\\s[^>]*>|>)([\\s\\S]*?)<\\/svg>/gim, '');\n\n // if the newContent contains a html, head or body tag, we can simply parse it w/o wrapping\n if (contentWithSvgsRemoved.match(/<\\/html>/) || contentWithSvgsRemoved.match(/<\\/head>/) || contentWithSvgsRemoved.match(/<\\/body>/)) {\n let content = parser.parseFromString(newContent, \"text/html\");\n // if it is a full HTML document, return the document itself as the parent container\n if (contentWithSvgsRemoved.match(/<\\/html>/)) {\n content.generatedByIdiomorph = true;\n return content;\n } else {\n // otherwise return the html element as the parent container\n let htmlElement = content.firstChild;\n if (htmlElement) {\n htmlElement.generatedByIdiomorph = true;\n return htmlElement;\n } else {\n return null;\n }\n }\n } else {\n // if it is partial HTML, wrap it in a template tag to provide a parent element and also to help\n // deal with touchy tags like tr, tbody, etc.\n let responseDoc = parser.parseFromString(\"<body><template>\" + newContent + \"</template></body>\", \"text/html\");\n let content = responseDoc.body.querySelector('template').content;\n content.generatedByIdiomorph = true;\n return content\n }\n }\n\n function normalizeContent(newContent) {\n if (newContent == null) {\n // noinspection UnnecessaryLocalVariableJS\n const dummyParent = document.createElement('div');\n return dummyParent;\n } else if (newContent.generatedByIdiomorph) {\n // the template tag created by idiomorph parsing can serve as a dummy parent\n return newContent;\n } else if (newContent instanceof Node) {\n // a single node is added as a child to a dummy parent\n const dummyParent = document.createElement('div');\n dummyParent.append(newContent);\n return dummyParent;\n } else {\n // all nodes in the array or HTMLElement collection are consolidated under\n // a single dummy parent element\n const dummyParent = document.createElement('div');\n for (const elt of [...newContent]) {\n dummyParent.append(elt);\n }\n return dummyParent;\n }\n }\n\n function insertSiblings(previousSibling, morphedNode, nextSibling) {\n let stack = [];\n let added = [];\n while (previousSibling != null) {\n stack.push(previousSibling);\n previousSibling = previousSibling.previousSibling;\n }\n while (stack.length > 0) {\n let node = stack.pop();\n added.push(node); // push added preceding siblings on in order and insert\n morphedNode.parentElement.insertBefore(node, morphedNode);\n }\n added.push(morphedNode);\n while (nextSibling != null) {\n stack.push(nextSibling);\n added.push(nextSibling); // here we are going in order, so push on as we scan, rather than add\n nextSibling = nextSibling.nextSibling;\n }\n while (stack.length > 0) {\n morphedNode.parentElement.insertBefore(stack.pop(), morphedNode.nextSibling);\n }\n return added;\n }\n\n function findBestNodeMatch(newContent, oldNode, ctx) {\n let currentElement;\n currentElement = newContent.firstChild;\n let bestElement = currentElement;\n let score = 0;\n while (currentElement) {\n let newScore = scoreElement(currentElement, oldNode, ctx);\n if (newScore > score) {\n bestElement = currentElement;\n score = newScore;\n }\n currentElement = currentElement.nextSibling;\n }\n return bestElement;\n }\n\n function scoreElement(node1, node2, ctx) {\n if (isSoftMatch(node1, node2)) {\n return .5 + getIdIntersectionCount(ctx, node1, node2);\n }\n return 0;\n }\n\n function removeNode(tempNode, ctx) {\n removeIdsFromConsideration(ctx, tempNode);\n if (ctx.callbacks.beforeNodeRemoved(tempNode) === false) return;\n\n tempNode.remove();\n ctx.callbacks.afterNodeRemoved(tempNode);\n }\n\n //=============================================================================\n // ID Set Functions\n //=============================================================================\n\n function isIdInConsideration(ctx, id) {\n return !ctx.deadIds.has(id);\n }\n\n function idIsWithinNode(ctx, id, targetNode) {\n let idSet = ctx.idMap.get(targetNode) || EMPTY_SET;\n return idSet.has(id);\n }\n\n function removeIdsFromConsideration(ctx, node) {\n let idSet = ctx.idMap.get(node) || EMPTY_SET;\n for (const id of idSet) {\n ctx.deadIds.add(id);\n }\n }\n\n function getIdIntersectionCount(ctx, node1, node2) {\n let sourceSet = ctx.idMap.get(node1) || EMPTY_SET;\n let matchCount = 0;\n for (const id of sourceSet) {\n // a potential match is an id in the source and potentialIdsSet, but\n // that has not already been merged into the DOM\n if (isIdInConsideration(ctx, id) && idIsWithinNode(ctx, id, node2)) {\n ++matchCount;\n }\n }\n return matchCount;\n }\n\n /**\n * A bottom up algorithm that finds all elements with ids inside of the node\n * argument and populates id sets for those nodes and all their parents, generating\n * a set of ids contained within all nodes for the entire hierarchy in the DOM\n *\n * @param node {Element}\n * @param {Map<Node, Set<String>>} idMap\n */\n function populateIdMapForNode(node, idMap) {\n let nodeParent = node.parentElement;\n // find all elements with an id property\n let idElements = node.querySelectorAll('[id]');\n for (const elt of idElements) {\n let current = elt;\n // walk up the parent hierarchy of that element, adding the id\n // of element to the parent's id set\n while (current !== nodeParent && current != null) {\n let idSet = idMap.get(current);\n // if the id set doesn't exist, create it and insert it in the map\n if (idSet == null) {\n idSet = new Set();\n idMap.set(current, idSet);\n }\n idSet.add(elt.id);\n current = current.parentElement;\n }\n }\n }\n\n /**\n * This function computes a map of nodes to all ids contained within that node (inclusive of the\n * node). This map can be used to ask if two nodes have intersecting sets of ids, which allows\n * for a looser definition of \"matching\" than tradition id matching, and allows child nodes\n * to contribute to a parent nodes matching.\n *\n * @param {Element} oldContent the old content that will be morphed\n * @param {Element} newContent the new content to morph to\n * @returns {Map<Node, Set<String>>} a map of nodes to id sets for the\n */\n function createIdMap(oldContent, newContent) {\n let idMap = new Map();\n populateIdMapForNode(oldContent, idMap);\n populateIdMapForNode(newContent, idMap);\n return idMap;\n }\n\n //=============================================================================\n // This is what ends up becoming the Idiomorph global object\n //=============================================================================\n return {\n morph,\n defaults\n }\n })();\n\nfunction morphElements(currentElement, newElement, { callbacks, ...options } = {}) {\n Idiomorph.morph(currentElement, newElement, {\n ...options,\n callbacks: new DefaultIdiomorphCallbacks(callbacks)\n });\n}\n\nfunction morphChildren(currentElement, newElement) {\n morphElements(currentElement, newElement.children, {\n morphStyle: \"innerHTML\"\n });\n}\n\nclass DefaultIdiomorphCallbacks {\n #beforeNodeMorphed\n\n constructor({ beforeNodeMorphed } = {}) {\n this.#beforeNodeMorphed = beforeNodeMorphed || (() => true);\n }\n\n beforeNodeAdded = (node) => {\n return !(node.id && node.hasAttribute(\"data-turbo-permanent\") && document.getElementById(node.id))\n }\n\n beforeNodeMorphed = (currentElement, newElement) => {\n if (currentElement instanceof Element) {\n if (!currentElement.hasAttribute(\"data-turbo-permanent\") && this.#beforeNodeMorphed(currentElement, newElement)) {\n const event = dispatch(\"turbo:before-morph-element\", {\n cancelable: true,\n target: currentElement,\n detail: { currentElement, newElement }\n });\n\n return !event.defaultPrevented\n } else {\n return false\n }\n }\n }\n\n beforeAttributeUpdated = (attributeName, target, mutationType) => {\n const event = dispatch(\"turbo:before-morph-attribute\", {\n cancelable: true,\n target,\n detail: { attributeName, mutationType }\n });\n\n return !event.defaultPrevented\n }\n\n beforeNodeRemoved = (node) => {\n return this.beforeNodeMorphed(node)\n }\n\n afterNodeMorphed = (currentElement, newElement) => {\n if (currentElement instanceof Element) {\n dispatch(\"turbo:morph-element\", {\n target: currentElement,\n detail: { currentElement, newElement }\n });\n }\n }\n}\n\nclass MorphingFrameRenderer extends FrameRenderer {\n static renderElement(currentElement, newElement) {\n dispatch(\"turbo:before-frame-morph\", {\n target: currentElement,\n detail: { currentElement, newElement }\n });\n\n morphChildren(currentElement, newElement);\n }\n\n async preservingPermanentElements(callback) {\n return await callback()\n }\n}\n\nclass ProgressBar {\n static animationDuration = 300 /*ms*/\n\n static get defaultCSS() {\n return unindent`\n .turbo-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 2147483647;\n transition:\n width ${ProgressBar.animationDuration}ms ease-out,\n opacity ${ProgressBar.animationDuration / 2}ms ${ProgressBar.animationDuration / 2}ms ease-in;\n transform: translate3d(0, 0, 0);\n }\n `\n }\n\n hiding = false\n value = 0\n visible = false\n\n constructor() {\n this.stylesheetElement = this.createStylesheetElement();\n this.progressElement = this.createProgressElement();\n this.installStylesheetElement();\n this.setValue(0);\n }\n\n show() {\n if (!this.visible) {\n this.visible = true;\n this.installProgressElement();\n this.startTrickling();\n }\n }\n\n hide() {\n if (this.visible && !this.hiding) {\n this.hiding = true;\n this.fadeProgressElement(() => {\n this.uninstallProgressElement();\n this.stopTrickling();\n this.visible = false;\n this.hiding = false;\n });\n }\n }\n\n setValue(value) {\n this.value = value;\n this.refresh();\n }\n\n // Private\n\n installStylesheetElement() {\n document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n }\n\n installProgressElement() {\n this.progressElement.style.width = \"0\";\n this.progressElement.style.opacity = \"1\";\n document.documentElement.insertBefore(this.progressElement, document.body);\n this.refresh();\n }\n\n fadeProgressElement(callback) {\n this.progressElement.style.opacity = \"0\";\n setTimeout(callback, ProgressBar.animationDuration * 1.5);\n }\n\n uninstallProgressElement() {\n if (this.progressElement.parentNode) {\n document.documentElement.removeChild(this.progressElement);\n }\n }\n\n startTrickling() {\n if (!this.trickleInterval) {\n this.trickleInterval = window.setInterval(this.trickle, ProgressBar.animationDuration);\n }\n }\n\n stopTrickling() {\n window.clearInterval(this.trickleInterval);\n delete this.trickleInterval;\n }\n\n trickle = () => {\n this.setValue(this.value + Math.random() / 100);\n }\n\n refresh() {\n requestAnimationFrame(() => {\n this.progressElement.style.width = `${10 + this.value * 90}%`;\n });\n }\n\n createStylesheetElement() {\n const element = document.createElement(\"style\");\n element.type = \"text/css\";\n element.textContent = ProgressBar.defaultCSS;\n const cspNonce = getCspNonce();\n if (cspNonce) {\n element.nonce = cspNonce;\n }\n return element\n }\n\n createProgressElement() {\n const element = document.createElement(\"div\");\n element.className = \"turbo-progress-bar\";\n return element\n }\n}\n\nclass HeadSnapshot extends Snapshot {\n detailsByOuterHTML = this.children\n .filter((element) => !elementIsNoscript(element))\n .map((element) => elementWithoutNonce(element))\n .reduce((result, element) => {\n const { outerHTML } = element;\n const details =\n outerHTML in result\n ? result[outerHTML]\n : {\n type: elementType(element),\n tracked: elementIsTracked(element),\n elements: []\n };\n return {\n ...result,\n [outerHTML]: {\n ...details,\n elements: [...details.elements, element]\n }\n }\n }, {})\n\n get trackedElementSignature() {\n return Object.keys(this.detailsByOuterHTML)\n .filter((outerHTML) => this.detailsByOuterHTML[outerHTML].tracked)\n .join(\"\")\n }\n\n getScriptElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"script\", snapshot)\n }\n\n getStylesheetElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"stylesheet\", snapshot)\n }\n\n getElementsMatchingTypeNotInSnapshot(matchedType, snapshot) {\n return Object.keys(this.detailsByOuterHTML)\n .filter((outerHTML) => !(outerHTML in snapshot.detailsByOuterHTML))\n .map((outerHTML) => this.detailsByOuterHTML[outerHTML])\n .filter(({ type }) => type == matchedType)\n .map(({ elements: [element] }) => element)\n }\n\n get provisionalElements() {\n return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n const { type, tracked, elements } = this.detailsByOuterHTML[outerHTML];\n if (type == null && !tracked) {\n return [...result, ...elements]\n } else if (elements.length > 1) {\n return [...result, ...elements.slice(1)]\n } else {\n return result\n }\n }, [])\n }\n\n getMetaValue(name) {\n const element = this.findMetaElementByName(name);\n return element ? element.getAttribute(\"content\") : null\n }\n\n findMetaElementByName(name) {\n return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n const {\n elements: [element]\n } = this.detailsByOuterHTML[outerHTML];\n return elementIsMetaElementWithName(element, name) ? element : result\n }, undefined | undefined)\n }\n}\n\nfunction elementType(element) {\n if (elementIsScript(element)) {\n return \"script\"\n } else if (elementIsStylesheet(element)) {\n return \"stylesheet\"\n }\n}\n\nfunction elementIsTracked(element) {\n return element.getAttribute(\"data-turbo-track\") == \"reload\"\n}\n\nfunction elementIsScript(element) {\n const tagName = element.localName;\n return tagName == \"script\"\n}\n\nfunction elementIsNoscript(element) {\n const tagName = element.localName;\n return tagName == \"noscript\"\n}\n\nfunction elementIsStylesheet(element) {\n const tagName = element.localName;\n return tagName == \"style\" || (tagName == \"link\" && element.getAttribute(\"rel\") == \"stylesheet\")\n}\n\nfunction elementIsMetaElementWithName(element, name) {\n const tagName = element.localName;\n return tagName == \"meta\" && element.getAttribute(\"name\") == name\n}\n\nfunction elementWithoutNonce(element) {\n if (element.hasAttribute(\"nonce\")) {\n element.setAttribute(\"nonce\", \"\");\n }\n\n return element\n}\n\nclass PageSnapshot extends Snapshot {\n static fromHTMLString(html = \"\") {\n return this.fromDocument(parseHTMLDocument(html))\n }\n\n static fromElement(element) {\n return this.fromDocument(element.ownerDocument)\n }\n\n static fromDocument({ documentElement, body, head }) {\n return new this(documentElement, body, new HeadSnapshot(head))\n }\n\n constructor(documentElement, body, headSnapshot) {\n super(body);\n this.documentElement = documentElement;\n this.headSnapshot = headSnapshot;\n }\n\n clone() {\n const clonedElement = this.element.cloneNode(true);\n\n const selectElements = this.element.querySelectorAll(\"select\");\n const clonedSelectElements = clonedElement.querySelectorAll(\"select\");\n\n for (const [index, source] of selectElements.entries()) {\n const clone = clonedSelectElements[index];\n for (const option of clone.selectedOptions) option.selected = false;\n for (const option of source.selectedOptions) clone.options[option.index].selected = true;\n }\n\n for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type=\"password\"]')) {\n clonedPasswordInput.value = \"\";\n }\n\n return new PageSnapshot(this.documentElement, clonedElement, this.headSnapshot)\n }\n\n get lang() {\n return this.documentElement.getAttribute(\"lang\")\n }\n\n get headElement() {\n return this.headSnapshot.element\n }\n\n get rootLocation() {\n const root = this.getSetting(\"root\") ?? \"/\";\n return expandURL(root)\n }\n\n get cacheControlValue() {\n return this.getSetting(\"cache-control\")\n }\n\n get isPreviewable() {\n return this.cacheControlValue != \"no-preview\"\n }\n\n get isCacheable() {\n return this.cacheControlValue != \"no-cache\"\n }\n\n get isVisitable() {\n return this.getSetting(\"visit-control\") != \"reload\"\n }\n\n get prefersViewTransitions() {\n return this.headSnapshot.getMetaValue(\"view-transition\") === \"same-origin\"\n }\n\n get shouldMorphPage() {\n return this.getSetting(\"refresh-method\") === \"morph\"\n }\n\n get shouldPreserveScrollPosition() {\n return this.getSetting(\"refresh-scroll\") === \"preserve\"\n }\n\n // Private\n\n getSetting(name) {\n return this.headSnapshot.getMetaValue(`turbo-${name}`)\n }\n}\n\nclass ViewTransitioner {\n #viewTransitionStarted = false\n #lastOperation = Promise.resolve()\n\n renderChange(useViewTransition, render) {\n if (useViewTransition && this.viewTransitionsAvailable && !this.#viewTransitionStarted) {\n this.#viewTransitionStarted = true;\n this.#lastOperation = this.#lastOperation.then(async () => {\n await document.startViewTransition(render).finished;\n });\n } else {\n this.#lastOperation = this.#lastOperation.then(render);\n }\n\n return this.#lastOperation\n }\n\n get viewTransitionsAvailable() {\n return document.startViewTransition\n }\n}\n\nconst defaultOptions = {\n action: \"advance\",\n historyChanged: false,\n visitCachedSnapshot: () => {},\n willRender: true,\n updateHistory: true,\n shouldCacheSnapshot: true,\n acceptsStreamResponse: false\n};\n\nconst TimingMetric = {\n visitStart: \"visitStart\",\n requestStart: \"requestStart\",\n requestEnd: \"requestEnd\",\n visitEnd: \"visitEnd\"\n};\n\nconst VisitState = {\n initialized: \"initialized\",\n started: \"started\",\n canceled: \"canceled\",\n failed: \"failed\",\n completed: \"completed\"\n};\n\nconst SystemStatusCode = {\n networkFailure: 0,\n timeoutFailure: -1,\n contentTypeMismatch: -2\n};\n\nconst Direction = {\n advance: \"forward\",\n restore: \"back\",\n replace: \"none\"\n};\n\nclass Visit {\n identifier = uuid() // Required by turbo-ios\n timingMetrics = {}\n\n followedRedirect = false\n historyChanged = false\n scrolled = false\n shouldCacheSnapshot = true\n acceptsStreamResponse = false\n snapshotCached = false\n state = VisitState.initialized\n viewTransitioner = new ViewTransitioner()\n\n constructor(delegate, location, restorationIdentifier, options = {}) {\n this.delegate = delegate;\n this.location = location;\n this.restorationIdentifier = restorationIdentifier || uuid();\n\n const {\n action,\n historyChanged,\n referrer,\n snapshot,\n snapshotHTML,\n response,\n visitCachedSnapshot,\n willRender,\n updateHistory,\n shouldCacheSnapshot,\n acceptsStreamResponse,\n direction\n } = {\n ...defaultOptions,\n ...options\n };\n this.action = action;\n this.historyChanged = historyChanged;\n this.referrer = referrer;\n this.snapshot = snapshot;\n this.snapshotHTML = snapshotHTML;\n this.response = response;\n this.isSamePage = this.delegate.locationWithActionIsSamePage(this.location, this.action);\n this.isPageRefresh = this.view.isPageRefresh(this);\n this.visitCachedSnapshot = visitCachedSnapshot;\n this.willRender = willRender;\n this.updateHistory = updateHistory;\n this.scrolled = !willRender;\n this.shouldCacheSnapshot = shouldCacheSnapshot;\n this.acceptsStreamResponse = acceptsStreamResponse;\n this.direction = direction || Direction[action];\n }\n\n get adapter() {\n return this.delegate.adapter\n }\n\n get view() {\n return this.delegate.view\n }\n\n get history() {\n return this.delegate.history\n }\n\n get restorationData() {\n return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)\n }\n\n get silent() {\n return this.isSamePage\n }\n\n start() {\n if (this.state == VisitState.initialized) {\n this.recordTimingMetric(TimingMetric.visitStart);\n this.state = VisitState.started;\n this.adapter.visitStarted(this);\n this.delegate.visitStarted(this);\n }\n }\n\n cancel() {\n if (this.state == VisitState.started) {\n if (this.request) {\n this.request.cancel();\n }\n this.cancelRender();\n this.state = VisitState.canceled;\n }\n }\n\n complete() {\n if (this.state == VisitState.started) {\n this.recordTimingMetric(TimingMetric.visitEnd);\n this.adapter.visitCompleted(this);\n this.state = VisitState.completed;\n this.followRedirect();\n\n if (!this.followedRedirect) {\n this.delegate.visitCompleted(this);\n }\n }\n }\n\n fail() {\n if (this.state == VisitState.started) {\n this.state = VisitState.failed;\n this.adapter.visitFailed(this);\n this.delegate.visitCompleted(this);\n }\n }\n\n changeHistory() {\n if (!this.historyChanged && this.updateHistory) {\n const actionForHistory = this.location.href === this.referrer?.href ? \"replace\" : this.action;\n const method = getHistoryMethodForAction(actionForHistory);\n this.history.update(method, this.location, this.restorationIdentifier);\n this.historyChanged = true;\n }\n }\n\n issueRequest() {\n if (this.hasPreloadedResponse()) {\n this.simulateRequest();\n } else if (this.shouldIssueRequest() && !this.request) {\n this.request = new FetchRequest(this, FetchMethod.get, this.location);\n this.request.perform();\n }\n }\n\n simulateRequest() {\n if (this.response) {\n this.startRequest();\n this.recordResponse();\n this.finishRequest();\n }\n }\n\n startRequest() {\n this.recordTimingMetric(TimingMetric.requestStart);\n this.adapter.visitRequestStarted(this);\n }\n\n recordResponse(response = this.response) {\n this.response = response;\n if (response) {\n const { statusCode } = response;\n if (isSuccessful(statusCode)) {\n this.adapter.visitRequestCompleted(this);\n } else {\n this.adapter.visitRequestFailedWithStatusCode(this, statusCode);\n }\n }\n }\n\n finishRequest() {\n this.recordTimingMetric(TimingMetric.requestEnd);\n this.adapter.visitRequestFinished(this);\n }\n\n loadResponse() {\n if (this.response) {\n const { statusCode, responseHTML } = this.response;\n this.render(async () => {\n if (this.shouldCacheSnapshot) this.cacheSnapshot();\n if (this.view.renderPromise) await this.view.renderPromise;\n\n if (isSuccessful(statusCode) && responseHTML != null) {\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n await this.renderPageSnapshot(snapshot, false);\n\n this.adapter.visitRendered(this);\n this.complete();\n } else {\n await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML), this);\n this.adapter.visitRendered(this);\n this.fail();\n }\n });\n }\n }\n\n getCachedSnapshot() {\n const snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();\n\n if (snapshot && (!getAnchor(this.location) || snapshot.hasAnchor(getAnchor(this.location)))) {\n if (this.action == \"restore\" || snapshot.isPreviewable) {\n return snapshot\n }\n }\n }\n\n getPreloadedSnapshot() {\n if (this.snapshotHTML) {\n return PageSnapshot.fromHTMLString(this.snapshotHTML)\n }\n }\n\n hasCachedSnapshot() {\n return this.getCachedSnapshot() != null\n }\n\n loadCachedSnapshot() {\n const snapshot = this.getCachedSnapshot();\n if (snapshot) {\n const isPreview = this.shouldIssueRequest();\n this.render(async () => {\n this.cacheSnapshot();\n if (this.isSamePage || this.isPageRefresh) {\n this.adapter.visitRendered(this);\n } else {\n if (this.view.renderPromise) await this.view.renderPromise;\n\n await this.renderPageSnapshot(snapshot, isPreview);\n\n this.adapter.visitRendered(this);\n if (!isPreview) {\n this.complete();\n }\n }\n });\n }\n }\n\n followRedirect() {\n if (this.redirectedToLocation && !this.followedRedirect && this.response?.redirected) {\n this.adapter.visitProposedToLocation(this.redirectedToLocation, {\n action: \"replace\",\n response: this.response,\n shouldCacheSnapshot: false,\n willRender: false\n });\n this.followedRedirect = true;\n }\n }\n\n goToSamePageAnchor() {\n if (this.isSamePage) {\n this.render(async () => {\n this.cacheSnapshot();\n this.performScroll();\n this.changeHistory();\n this.adapter.visitRendered(this);\n });\n }\n }\n\n // Fetch request delegate\n\n prepareRequest(request) {\n if (this.acceptsStreamResponse) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n\n requestStarted() {\n this.startRequest();\n }\n\n requestPreventedHandlingResponse(_request, _response) {}\n\n async requestSucceededWithResponse(request, response) {\n const responseHTML = await response.responseHTML;\n const { redirected, statusCode } = response;\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected\n });\n } else {\n this.redirectedToLocation = response.redirected ? response.location : undefined;\n this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n }\n }\n\n async requestFailedWithResponse(request, response) {\n const responseHTML = await response.responseHTML;\n const { redirected, statusCode } = response;\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected\n });\n } else {\n this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n }\n }\n\n requestErrored(_request, _error) {\n this.recordResponse({\n statusCode: SystemStatusCode.networkFailure,\n redirected: false\n });\n }\n\n requestFinished() {\n this.finishRequest();\n }\n\n // Scrolling\n\n performScroll() {\n if (!this.scrolled && !this.view.forceReloaded && !this.view.shouldPreserveScrollPosition(this)) {\n if (this.action == \"restore\") {\n this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();\n } else {\n this.scrollToAnchor() || this.view.scrollToTop();\n }\n if (this.isSamePage) {\n this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation, this.location);\n }\n\n this.scrolled = true;\n }\n }\n\n scrollToRestoredPosition() {\n const { scrollPosition } = this.restorationData;\n if (scrollPosition) {\n this.view.scrollToPosition(scrollPosition);\n return true\n }\n }\n\n scrollToAnchor() {\n const anchor = getAnchor(this.location);\n if (anchor != null) {\n this.view.scrollToAnchor(anchor);\n return true\n }\n }\n\n // Instrumentation\n\n recordTimingMetric(metric) {\n this.timingMetrics[metric] = new Date().getTime();\n }\n\n getTimingMetrics() {\n return { ...this.timingMetrics }\n }\n\n // Private\n\n getHistoryMethodForAction(action) {\n switch (action) {\n case \"replace\":\n return history.replaceState\n case \"advance\":\n case \"restore\":\n return history.pushState\n }\n }\n\n hasPreloadedResponse() {\n return typeof this.response == \"object\"\n }\n\n shouldIssueRequest() {\n if (this.isSamePage) {\n return false\n } else if (this.action == \"restore\") {\n return !this.hasCachedSnapshot()\n } else {\n return this.willRender\n }\n }\n\n cacheSnapshot() {\n if (!this.snapshotCached) {\n this.view.cacheSnapshot(this.snapshot).then((snapshot) => snapshot && this.visitCachedSnapshot(snapshot));\n this.snapshotCached = true;\n }\n }\n\n async render(callback) {\n this.cancelRender();\n await new Promise((resolve) => {\n this.frame =\n document.visibilityState === \"hidden\" ? setTimeout(() => resolve(), 0) : requestAnimationFrame(() => resolve());\n });\n await callback();\n delete this.frame;\n }\n\n async renderPageSnapshot(snapshot, isPreview) {\n await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(snapshot), async () => {\n await this.view.renderPage(snapshot, isPreview, this.willRender, this);\n this.performScroll();\n });\n }\n\n cancelRender() {\n if (this.frame) {\n cancelAnimationFrame(this.frame);\n delete this.frame;\n }\n }\n}\n\nfunction isSuccessful(statusCode) {\n return statusCode >= 200 && statusCode < 300\n}\n\nclass BrowserAdapter {\n progressBar = new ProgressBar()\n\n constructor(session) {\n this.session = session;\n }\n\n visitProposedToLocation(location, options) {\n if (locationIsVisitable(location, this.navigator.rootLocation)) {\n this.navigator.startVisit(location, options?.restorationIdentifier || uuid(), options);\n } else {\n window.location.href = location.toString();\n }\n }\n\n visitStarted(visit) {\n this.location = visit.location;\n visit.loadCachedSnapshot();\n visit.issueRequest();\n visit.goToSamePageAnchor();\n }\n\n visitRequestStarted(visit) {\n this.progressBar.setValue(0);\n if (visit.hasCachedSnapshot() || visit.action != \"restore\") {\n this.showVisitProgressBarAfterDelay();\n } else {\n this.showProgressBar();\n }\n }\n\n visitRequestCompleted(visit) {\n visit.loadResponse();\n }\n\n visitRequestFailedWithStatusCode(visit, statusCode) {\n switch (statusCode) {\n case SystemStatusCode.networkFailure:\n case SystemStatusCode.timeoutFailure:\n case SystemStatusCode.contentTypeMismatch:\n return this.reload({\n reason: \"request_failed\",\n context: {\n statusCode\n }\n })\n default:\n return visit.loadResponse()\n }\n }\n\n visitRequestFinished(_visit) {}\n\n visitCompleted(_visit) {\n this.progressBar.setValue(1);\n this.hideVisitProgressBar();\n }\n\n pageInvalidated(reason) {\n this.reload(reason);\n }\n\n visitFailed(_visit) {\n this.progressBar.setValue(1);\n this.hideVisitProgressBar();\n }\n\n visitRendered(_visit) {}\n\n // Form Submission Delegate\n\n formSubmissionStarted(_formSubmission) {\n this.progressBar.setValue(0);\n this.showFormProgressBarAfterDelay();\n }\n\n formSubmissionFinished(_formSubmission) {\n this.progressBar.setValue(1);\n this.hideFormProgressBar();\n }\n\n // Private\n\n showVisitProgressBarAfterDelay() {\n this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n\n hideVisitProgressBar() {\n this.progressBar.hide();\n if (this.visitProgressBarTimeout != null) {\n window.clearTimeout(this.visitProgressBarTimeout);\n delete this.visitProgressBarTimeout;\n }\n }\n\n showFormProgressBarAfterDelay() {\n if (this.formProgressBarTimeout == null) {\n this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n }\n\n hideFormProgressBar() {\n this.progressBar.hide();\n if (this.formProgressBarTimeout != null) {\n window.clearTimeout(this.formProgressBarTimeout);\n delete this.formProgressBarTimeout;\n }\n }\n\n showProgressBar = () => {\n this.progressBar.show();\n }\n\n reload(reason) {\n dispatch(\"turbo:reload\", { detail: reason });\n\n window.location.href = this.location?.toString() || window.location.href;\n }\n\n get navigator() {\n return this.session.navigator\n }\n}\n\nclass CacheObserver {\n selector = \"[data-turbo-temporary]\"\n deprecatedSelector = \"[data-turbo-cache=false]\"\n\n started = false\n\n start() {\n if (!this.started) {\n this.started = true;\n addEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n\n stop() {\n if (this.started) {\n this.started = false;\n removeEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n\n removeTemporaryElements = (_event) => {\n for (const element of this.temporaryElements) {\n element.remove();\n }\n }\n\n get temporaryElements() {\n return [...document.querySelectorAll(this.selector), ...this.temporaryElementsWithDeprecation]\n }\n\n get temporaryElementsWithDeprecation() {\n const elements = document.querySelectorAll(this.deprecatedSelector);\n\n if (elements.length) {\n console.warn(\n `The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`\n );\n }\n\n return [...elements]\n }\n}\n\nclass FrameRedirector {\n constructor(session, element) {\n this.session = session;\n this.element = element;\n this.linkInterceptor = new LinkInterceptor(this, element);\n this.formSubmitObserver = new FormSubmitObserver(this, element);\n }\n\n start() {\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\n }\n\n stop() {\n this.linkInterceptor.stop();\n this.formSubmitObserver.stop();\n }\n\n // Link interceptor delegate\n\n shouldInterceptLinkClick(element, _location, _event) {\n return this.#shouldRedirect(element)\n }\n\n linkClickIntercepted(element, url, event) {\n const frame = this.#findFrameElement(element);\n if (frame) {\n frame.delegate.linkClickIntercepted(element, url, event);\n }\n }\n\n // Form submit observer delegate\n\n willSubmitForm(element, submitter) {\n return (\n element.closest(\"turbo-frame\") == null &&\n this.#shouldSubmit(element, submitter) &&\n this.#shouldRedirect(element, submitter)\n )\n }\n\n formSubmitted(element, submitter) {\n const frame = this.#findFrameElement(element, submitter);\n if (frame) {\n frame.delegate.formSubmitted(element, submitter);\n }\n }\n\n #shouldSubmit(form, submitter) {\n const action = getAction$1(form, submitter);\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const rootLocation = expandURL(meta?.content ?? \"/\");\n\n return this.#shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation)\n }\n\n #shouldRedirect(element, submitter) {\n const isNavigatable =\n element instanceof HTMLFormElement\n ? this.session.submissionIsNavigatable(element, submitter)\n : this.session.elementIsNavigatable(element);\n\n if (isNavigatable) {\n const frame = this.#findFrameElement(element, submitter);\n return frame ? frame != element.closest(\"turbo-frame\") : false\n } else {\n return false\n }\n }\n\n #findFrameElement(element, submitter) {\n const id = submitter?.getAttribute(\"data-turbo-frame\") || element.getAttribute(\"data-turbo-frame\");\n if (id && id != \"_top\") {\n const frame = this.element.querySelector(`#${id}:not([disabled])`);\n if (frame instanceof FrameElement) {\n return frame\n }\n }\n }\n}\n\nclass History {\n location\n restorationIdentifier = uuid()\n restorationData = {}\n started = false\n pageLoaded = false\n currentIndex = 0\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.started) {\n addEventListener(\"popstate\", this.onPopState, false);\n addEventListener(\"load\", this.onPageLoad, false);\n this.currentIndex = history.state?.turbo?.restorationIndex || 0;\n this.started = true;\n this.replace(new URL(window.location.href));\n }\n }\n\n stop() {\n if (this.started) {\n removeEventListener(\"popstate\", this.onPopState, false);\n removeEventListener(\"load\", this.onPageLoad, false);\n this.started = false;\n }\n }\n\n push(location, restorationIdentifier) {\n this.update(history.pushState, location, restorationIdentifier);\n }\n\n replace(location, restorationIdentifier) {\n this.update(history.replaceState, location, restorationIdentifier);\n }\n\n update(method, location, restorationIdentifier = uuid()) {\n if (method === history.pushState) ++this.currentIndex;\n\n const state = { turbo: { restorationIdentifier, restorationIndex: this.currentIndex } };\n method.call(history, state, \"\", location.href);\n this.location = location;\n this.restorationIdentifier = restorationIdentifier;\n }\n\n // Restoration data\n\n getRestorationDataForIdentifier(restorationIdentifier) {\n return this.restorationData[restorationIdentifier] || {}\n }\n\n updateRestorationData(additionalData) {\n const { restorationIdentifier } = this;\n const restorationData = this.restorationData[restorationIdentifier];\n this.restorationData[restorationIdentifier] = {\n ...restorationData,\n ...additionalData\n };\n }\n\n // Scroll restoration\n\n assumeControlOfScrollRestoration() {\n if (!this.previousScrollRestoration) {\n this.previousScrollRestoration = history.scrollRestoration ?? \"auto\";\n history.scrollRestoration = \"manual\";\n }\n }\n\n relinquishControlOfScrollRestoration() {\n if (this.previousScrollRestoration) {\n history.scrollRestoration = this.previousScrollRestoration;\n delete this.previousScrollRestoration;\n }\n }\n\n // Event handlers\n\n onPopState = (event) => {\n if (this.shouldHandlePopState()) {\n const { turbo } = event.state || {};\n if (turbo) {\n this.location = new URL(window.location.href);\n const { restorationIdentifier, restorationIndex } = turbo;\n this.restorationIdentifier = restorationIdentifier;\n const direction = restorationIndex > this.currentIndex ? \"forward\" : \"back\";\n this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location, restorationIdentifier, direction);\n this.currentIndex = restorationIndex;\n }\n }\n }\n\n onPageLoad = async (_event) => {\n await nextMicrotask();\n this.pageLoaded = true;\n }\n\n // Private\n\n shouldHandlePopState() {\n // Safari dispatches a popstate event after window's load event, ignore it\n return this.pageIsLoaded()\n }\n\n pageIsLoaded() {\n return this.pageLoaded || document.readyState == \"complete\"\n }\n}\n\nclass LinkPrefetchObserver {\n started = false\n #prefetchedLink = null\n\n constructor(delegate, eventTarget) {\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n\n start() {\n if (this.started) return\n\n if (this.eventTarget.readyState === \"loading\") {\n this.eventTarget.addEventListener(\"DOMContentLoaded\", this.#enable, { once: true });\n } else {\n this.#enable();\n }\n }\n\n stop() {\n if (!this.started) return\n\n this.eventTarget.removeEventListener(\"mouseenter\", this.#tryToPrefetchRequest, {\n capture: true,\n passive: true\n });\n this.eventTarget.removeEventListener(\"mouseleave\", this.#cancelRequestIfObsolete, {\n capture: true,\n passive: true\n });\n\n this.eventTarget.removeEventListener(\"turbo:before-fetch-request\", this.#tryToUsePrefetchedRequest, true);\n this.started = false;\n }\n\n #enable = () => {\n this.eventTarget.addEventListener(\"mouseenter\", this.#tryToPrefetchRequest, {\n capture: true,\n passive: true\n });\n this.eventTarget.addEventListener(\"mouseleave\", this.#cancelRequestIfObsolete, {\n capture: true,\n passive: true\n });\n\n this.eventTarget.addEventListener(\"turbo:before-fetch-request\", this.#tryToUsePrefetchedRequest, true);\n this.started = true;\n }\n\n #tryToPrefetchRequest = (event) => {\n if (getMetaContent(\"turbo-prefetch\") === \"false\") return\n\n const target = event.target;\n const isLink = target.matches && target.matches(\"a[href]:not([target^=_]):not([download])\");\n\n if (isLink && this.#isPrefetchable(target)) {\n const link = target;\n const location = getLocationForLink(link);\n\n if (this.delegate.canPrefetchRequestToLocation(link, location)) {\n this.#prefetchedLink = link;\n\n const fetchRequest = new FetchRequest(\n this,\n FetchMethod.get,\n location,\n new URLSearchParams(),\n target\n );\n\n prefetchCache.setLater(location.toString(), fetchRequest, this.#cacheTtl);\n }\n }\n }\n\n #cancelRequestIfObsolete = (event) => {\n if (event.target === this.#prefetchedLink) this.#cancelPrefetchRequest();\n }\n\n #cancelPrefetchRequest = () => {\n prefetchCache.clear();\n this.#prefetchedLink = null;\n }\n\n #tryToUsePrefetchedRequest = (event) => {\n if (event.target.tagName !== \"FORM\" && event.detail.fetchOptions.method === \"GET\") {\n const cached = prefetchCache.get(event.detail.url.toString());\n\n if (cached) {\n // User clicked link, use cache response\n event.detail.fetchRequest = cached;\n }\n\n prefetchCache.clear();\n }\n }\n\n prepareRequest(request) {\n const link = request.target;\n\n request.headers[\"X-Sec-Purpose\"] = \"prefetch\";\n\n const turboFrame = link.closest(\"turbo-frame\");\n const turboFrameTarget = link.getAttribute(\"data-turbo-frame\") || turboFrame?.getAttribute(\"target\") || turboFrame?.id;\n\n if (turboFrameTarget && turboFrameTarget !== \"_top\") {\n request.headers[\"Turbo-Frame\"] = turboFrameTarget;\n }\n }\n\n // Fetch request interface\n\n requestSucceededWithResponse() {}\n\n requestStarted(fetchRequest) {}\n\n requestErrored(fetchRequest) {}\n\n requestFinished(fetchRequest) {}\n\n requestPreventedHandlingResponse(fetchRequest, fetchResponse) {}\n\n requestFailedWithResponse(fetchRequest, fetchResponse) {}\n\n get #cacheTtl() {\n return Number(getMetaContent(\"turbo-prefetch-cache-time\")) || cacheTtl\n }\n\n #isPrefetchable(link) {\n const href = link.getAttribute(\"href\");\n\n if (!href) return false\n\n if (unfetchableLink(link)) return false\n if (linkToTheSamePage(link)) return false\n if (linkOptsOut(link)) return false\n if (nonSafeLink(link)) return false\n if (eventPrevented(link)) return false\n\n return true\n }\n}\n\nconst unfetchableLink = (link) => {\n return link.origin !== document.location.origin || ![\"http:\", \"https:\"].includes(link.protocol) || link.hasAttribute(\"target\")\n};\n\nconst linkToTheSamePage = (link) => {\n return (link.pathname + link.search === document.location.pathname + document.location.search) || link.href.startsWith(\"#\")\n};\n\nconst linkOptsOut = (link) => {\n if (link.getAttribute(\"data-turbo-prefetch\") === \"false\") return true\n if (link.getAttribute(\"data-turbo\") === \"false\") return true\n\n const turboPrefetchParent = findClosestRecursively(link, \"[data-turbo-prefetch]\");\n if (turboPrefetchParent && turboPrefetchParent.getAttribute(\"data-turbo-prefetch\") === \"false\") return true\n\n return false\n};\n\nconst nonSafeLink = (link) => {\n const turboMethod = link.getAttribute(\"data-turbo-method\");\n if (turboMethod && turboMethod.toLowerCase() !== \"get\") return true\n\n if (isUJS(link)) return true\n if (link.hasAttribute(\"data-turbo-confirm\")) return true\n if (link.hasAttribute(\"data-turbo-stream\")) return true\n\n return false\n};\n\nconst isUJS = (link) => {\n return link.hasAttribute(\"data-remote\") || link.hasAttribute(\"data-behavior\") || link.hasAttribute(\"data-confirm\") || link.hasAttribute(\"data-method\")\n};\n\nconst eventPrevented = (link) => {\n const event = dispatch(\"turbo:before-prefetch\", { target: link, cancelable: true });\n return event.defaultPrevented\n};\n\nclass Navigator {\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n proposeVisit(location, options = {}) {\n if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {\n this.delegate.visitProposedToLocation(location, options);\n }\n }\n\n startVisit(locatable, restorationIdentifier, options = {}) {\n this.stop();\n this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, {\n referrer: this.location,\n ...options\n });\n this.currentVisit.start();\n }\n\n submitForm(form, submitter) {\n this.stop();\n this.formSubmission = new FormSubmission(this, form, submitter, true);\n\n this.formSubmission.start();\n }\n\n stop() {\n if (this.formSubmission) {\n this.formSubmission.stop();\n delete this.formSubmission;\n }\n\n if (this.currentVisit) {\n this.currentVisit.cancel();\n delete this.currentVisit;\n }\n }\n\n get adapter() {\n return this.delegate.adapter\n }\n\n get view() {\n return this.delegate.view\n }\n\n get rootLocation() {\n return this.view.snapshot.rootLocation\n }\n\n get history() {\n return this.delegate.history\n }\n\n // Form submission delegate\n\n formSubmissionStarted(formSubmission) {\n // Not all adapters implement formSubmissionStarted\n if (typeof this.adapter.formSubmissionStarted === \"function\") {\n this.adapter.formSubmissionStarted(formSubmission);\n }\n }\n\n async formSubmissionSucceededWithResponse(formSubmission, fetchResponse) {\n if (formSubmission == this.formSubmission) {\n const responseHTML = await fetchResponse.responseHTML;\n if (responseHTML) {\n const shouldCacheSnapshot = formSubmission.isSafe;\n if (!shouldCacheSnapshot) {\n this.view.clearSnapshotCache();\n }\n\n const { statusCode, redirected } = fetchResponse;\n const action = this.#getActionForFormSubmission(formSubmission, fetchResponse);\n const visitOptions = {\n action,\n shouldCacheSnapshot,\n response: { statusCode, responseHTML, redirected }\n };\n this.proposeVisit(fetchResponse.location, visitOptions);\n }\n }\n }\n\n async formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n const responseHTML = await fetchResponse.responseHTML;\n\n if (responseHTML) {\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n if (fetchResponse.serverError) {\n await this.view.renderError(snapshot, this.currentVisit);\n } else {\n await this.view.renderPage(snapshot, false, true, this.currentVisit);\n }\n if(!snapshot.shouldPreserveScrollPosition) {\n this.view.scrollToTop();\n }\n this.view.clearSnapshotCache();\n }\n }\n\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n\n formSubmissionFinished(formSubmission) {\n // Not all adapters implement formSubmissionFinished\n if (typeof this.adapter.formSubmissionFinished === \"function\") {\n this.adapter.formSubmissionFinished(formSubmission);\n }\n }\n\n // Visit delegate\n\n visitStarted(visit) {\n this.delegate.visitStarted(visit);\n }\n\n visitCompleted(visit) {\n this.delegate.visitCompleted(visit);\n delete this.currentVisit;\n }\n\n locationWithActionIsSamePage(location, action) {\n const anchor = getAnchor(location);\n const currentAnchor = getAnchor(this.view.lastRenderedLocation);\n const isRestorationToTop = action === \"restore\" && typeof anchor === \"undefined\";\n\n return (\n action !== \"replace\" &&\n getRequestURL(location) === getRequestURL(this.view.lastRenderedLocation) &&\n (isRestorationToTop || (anchor != null && anchor !== currentAnchor))\n )\n }\n\n visitScrolledToSamePageLocation(oldURL, newURL) {\n this.delegate.visitScrolledToSamePageLocation(oldURL, newURL);\n }\n\n // Visits\n\n get location() {\n return this.history.location\n }\n\n get restorationIdentifier() {\n return this.history.restorationIdentifier\n }\n\n #getActionForFormSubmission(formSubmission, fetchResponse) {\n const { submitter, formElement } = formSubmission;\n return getVisitAction(submitter, formElement) || this.#getDefaultAction(fetchResponse)\n }\n\n #getDefaultAction(fetchResponse) {\n const sameLocationRedirect = fetchResponse.redirected && fetchResponse.location.href === this.location?.href;\n return sameLocationRedirect ? \"replace\" : \"advance\"\n }\n}\n\nconst PageStage = {\n initial: 0,\n loading: 1,\n interactive: 2,\n complete: 3\n};\n\nclass PageObserver {\n stage = PageStage.initial\n started = false\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.started) {\n if (this.stage == PageStage.initial) {\n this.stage = PageStage.loading;\n }\n document.addEventListener(\"readystatechange\", this.interpretReadyState, false);\n addEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n document.removeEventListener(\"readystatechange\", this.interpretReadyState, false);\n removeEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = false;\n }\n }\n\n interpretReadyState = () => {\n const { readyState } = this;\n if (readyState == \"interactive\") {\n this.pageIsInteractive();\n } else if (readyState == \"complete\") {\n this.pageIsComplete();\n }\n }\n\n pageIsInteractive() {\n if (this.stage == PageStage.loading) {\n this.stage = PageStage.interactive;\n this.delegate.pageBecameInteractive();\n }\n }\n\n pageIsComplete() {\n this.pageIsInteractive();\n if (this.stage == PageStage.interactive) {\n this.stage = PageStage.complete;\n this.delegate.pageLoaded();\n }\n }\n\n pageWillUnload = () => {\n this.delegate.pageWillUnload();\n }\n\n get readyState() {\n return document.readyState\n }\n}\n\nclass ScrollObserver {\n started = false\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.started) {\n addEventListener(\"scroll\", this.onScroll, false);\n this.onScroll();\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n removeEventListener(\"scroll\", this.onScroll, false);\n this.started = false;\n }\n }\n\n onScroll = () => {\n this.updatePosition({ x: window.pageXOffset, y: window.pageYOffset });\n }\n\n // Private\n\n updatePosition(position) {\n this.delegate.scrollPositionChanged(position);\n }\n}\n\nclass StreamMessageRenderer {\n render({ fragment }) {\n Bardo.preservingPermanentElements(this, getPermanentElementMapForFragment(fragment), () => {\n withAutofocusFromFragment(fragment, () => {\n withPreservedFocus(() => {\n document.documentElement.appendChild(fragment);\n });\n });\n });\n }\n\n // Bardo delegate\n\n enteringBardo(currentPermanentElement, newPermanentElement) {\n newPermanentElement.replaceWith(currentPermanentElement.cloneNode(true));\n }\n\n leavingBardo() {}\n}\n\nfunction getPermanentElementMapForFragment(fragment) {\n const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);\n const permanentElementMap = {};\n for (const permanentElementInDocument of permanentElementsInDocument) {\n const { id } = permanentElementInDocument;\n\n for (const streamElement of fragment.querySelectorAll(\"turbo-stream\")) {\n const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);\n\n if (elementInStream) {\n permanentElementMap[id] = [permanentElementInDocument, elementInStream];\n }\n }\n }\n\n return permanentElementMap\n}\n\nasync function withAutofocusFromFragment(fragment, callback) {\n const generatedID = `turbo-stream-autofocus-${uuid()}`;\n const turboStreams = fragment.querySelectorAll(\"turbo-stream\");\n const elementWithAutofocus = firstAutofocusableElementInStreams(turboStreams);\n let willAutofocusId = null;\n\n if (elementWithAutofocus) {\n if (elementWithAutofocus.id) {\n willAutofocusId = elementWithAutofocus.id;\n } else {\n willAutofocusId = generatedID;\n }\n\n elementWithAutofocus.id = willAutofocusId;\n }\n\n callback();\n await nextRepaint();\n\n const hasNoActiveElement = document.activeElement == null || document.activeElement == document.body;\n\n if (hasNoActiveElement && willAutofocusId) {\n const elementToAutofocus = document.getElementById(willAutofocusId);\n\n if (elementIsFocusable(elementToAutofocus)) {\n elementToAutofocus.focus();\n }\n if (elementToAutofocus && elementToAutofocus.id == generatedID) {\n elementToAutofocus.removeAttribute(\"id\");\n }\n }\n}\n\nasync function withPreservedFocus(callback) {\n const [activeElementBeforeRender, activeElementAfterRender] = await around(callback, () => document.activeElement);\n\n const restoreFocusTo = activeElementBeforeRender && activeElementBeforeRender.id;\n\n if (restoreFocusTo) {\n const elementToFocus = document.getElementById(restoreFocusTo);\n\n if (elementIsFocusable(elementToFocus) && elementToFocus != activeElementAfterRender) {\n elementToFocus.focus();\n }\n }\n}\n\nfunction firstAutofocusableElementInStreams(nodeListOfStreamElements) {\n for (const streamElement of nodeListOfStreamElements) {\n const elementWithAutofocus = queryAutofocusableElement(streamElement.templateElement.content);\n\n if (elementWithAutofocus) return elementWithAutofocus\n }\n\n return null\n}\n\nclass StreamObserver {\n sources = new Set()\n #started = false\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.#started) {\n this.#started = true;\n addEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n\n stop() {\n if (this.#started) {\n this.#started = false;\n removeEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n\n connectStreamSource(source) {\n if (!this.streamSourceIsConnected(source)) {\n this.sources.add(source);\n source.addEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n\n disconnectStreamSource(source) {\n if (this.streamSourceIsConnected(source)) {\n this.sources.delete(source);\n source.removeEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n\n streamSourceIsConnected(source) {\n return this.sources.has(source)\n }\n\n inspectFetchResponse = (event) => {\n const response = fetchResponseFromEvent(event);\n if (response && fetchResponseIsStream(response)) {\n event.preventDefault();\n this.receiveMessageResponse(response);\n }\n }\n\n receiveMessageEvent = (event) => {\n if (this.#started && typeof event.data == \"string\") {\n this.receiveMessageHTML(event.data);\n }\n }\n\n async receiveMessageResponse(response) {\n const html = await response.responseHTML;\n if (html) {\n this.receiveMessageHTML(html);\n }\n }\n\n receiveMessageHTML(html) {\n this.delegate.receivedMessageFromStream(StreamMessage.wrap(html));\n }\n}\n\nfunction fetchResponseFromEvent(event) {\n const fetchResponse = event.detail?.fetchResponse;\n if (fetchResponse instanceof FetchResponse) {\n return fetchResponse\n }\n}\n\nfunction fetchResponseIsStream(response) {\n const contentType = response.contentType ?? \"\";\n return contentType.startsWith(StreamMessage.contentType)\n}\n\nclass ErrorRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n const { documentElement, body } = document;\n\n documentElement.replaceChild(newElement, body);\n }\n\n async render() {\n this.replaceHeadAndBody();\n this.activateScriptElements();\n }\n\n replaceHeadAndBody() {\n const { documentElement, head } = document;\n documentElement.replaceChild(this.newHead, head);\n this.renderElement(this.currentElement, this.newElement);\n }\n\n activateScriptElements() {\n for (const replaceableElement of this.scriptElements) {\n const parentNode = replaceableElement.parentNode;\n if (parentNode) {\n const element = activateScriptElement(replaceableElement);\n parentNode.replaceChild(element, replaceableElement);\n }\n }\n }\n\n get newHead() {\n return this.newSnapshot.headSnapshot.element\n }\n\n get scriptElements() {\n return document.documentElement.querySelectorAll(\"script\")\n }\n}\n\nclass PageRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n if (document.body && newElement instanceof HTMLBodyElement) {\n document.body.replaceWith(newElement);\n } else {\n document.documentElement.appendChild(newElement);\n }\n }\n\n get shouldRender() {\n return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical\n }\n\n get reloadReason() {\n if (!this.newSnapshot.isVisitable) {\n return {\n reason: \"turbo_visit_control_is_reload\"\n }\n }\n\n if (!this.trackedElementsAreIdentical) {\n return {\n reason: \"tracked_element_mismatch\"\n }\n }\n }\n\n async prepareToRender() {\n this.#setLanguage();\n await this.mergeHead();\n }\n\n async render() {\n if (this.willRender) {\n await this.replaceBody();\n }\n }\n\n finishRendering() {\n super.finishRendering();\n if (!this.isPreview) {\n this.focusFirstAutofocusableElement();\n }\n }\n\n get currentHeadSnapshot() {\n return this.currentSnapshot.headSnapshot\n }\n\n get newHeadSnapshot() {\n return this.newSnapshot.headSnapshot\n }\n\n get newElement() {\n return this.newSnapshot.element\n }\n\n #setLanguage() {\n const { documentElement } = this.currentSnapshot;\n const { lang } = this.newSnapshot;\n\n if (lang) {\n documentElement.setAttribute(\"lang\", lang);\n } else {\n documentElement.removeAttribute(\"lang\");\n }\n }\n\n async mergeHead() {\n const mergedHeadElements = this.mergeProvisionalElements();\n const newStylesheetElements = this.copyNewHeadStylesheetElements();\n this.copyNewHeadScriptElements();\n\n await mergedHeadElements;\n await newStylesheetElements;\n\n if (this.willRender) {\n this.removeUnusedDynamicStylesheetElements();\n }\n }\n\n async replaceBody() {\n await this.preservingPermanentElements(async () => {\n this.activateNewBody();\n await this.assignNewBody();\n });\n }\n\n get trackedElementsAreIdentical() {\n return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature\n }\n\n async copyNewHeadStylesheetElements() {\n const loadingElements = [];\n\n for (const element of this.newHeadStylesheetElements) {\n loadingElements.push(waitForLoad(element));\n\n document.head.appendChild(element);\n }\n\n await Promise.all(loadingElements);\n }\n\n copyNewHeadScriptElements() {\n for (const element of this.newHeadScriptElements) {\n document.head.appendChild(activateScriptElement(element));\n }\n }\n\n removeUnusedDynamicStylesheetElements() {\n for (const element of this.unusedDynamicStylesheetElements) {\n document.head.removeChild(element);\n }\n }\n\n async mergeProvisionalElements() {\n const newHeadElements = [...this.newHeadProvisionalElements];\n\n for (const element of this.currentHeadProvisionalElements) {\n if (!this.isCurrentElementInElementList(element, newHeadElements)) {\n document.head.removeChild(element);\n }\n }\n\n for (const element of newHeadElements) {\n document.head.appendChild(element);\n }\n }\n\n isCurrentElementInElementList(element, elementList) {\n for (const [index, newElement] of elementList.entries()) {\n // if title element...\n if (element.tagName == \"TITLE\") {\n if (newElement.tagName != \"TITLE\") {\n continue\n }\n if (element.innerHTML == newElement.innerHTML) {\n elementList.splice(index, 1);\n return true\n }\n }\n\n // if any other element...\n if (newElement.isEqualNode(element)) {\n elementList.splice(index, 1);\n return true\n }\n }\n\n return false\n }\n\n removeCurrentHeadProvisionalElements() {\n for (const element of this.currentHeadProvisionalElements) {\n document.head.removeChild(element);\n }\n }\n\n copyNewHeadProvisionalElements() {\n for (const element of this.newHeadProvisionalElements) {\n document.head.appendChild(element);\n }\n }\n\n activateNewBody() {\n document.adoptNode(this.newElement);\n this.activateNewBodyScriptElements();\n }\n\n activateNewBodyScriptElements() {\n for (const inertScriptElement of this.newBodyScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n\n async assignNewBody() {\n await this.renderElement(this.currentElement, this.newElement);\n }\n\n get unusedDynamicStylesheetElements() {\n return this.oldHeadStylesheetElements.filter((element) => {\n return element.getAttribute(\"data-turbo-track\") === \"dynamic\"\n })\n }\n\n get oldHeadStylesheetElements() {\n return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)\n }\n\n get newHeadStylesheetElements() {\n return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)\n }\n\n get newHeadScriptElements() {\n return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)\n }\n\n get currentHeadProvisionalElements() {\n return this.currentHeadSnapshot.provisionalElements\n }\n\n get newHeadProvisionalElements() {\n return this.newHeadSnapshot.provisionalElements\n }\n\n get newBodyScriptElements() {\n return this.newElement.querySelectorAll(\"script\")\n }\n}\n\nclass MorphingPageRenderer extends PageRenderer {\n static renderElement(currentElement, newElement) {\n morphElements(currentElement, newElement, {\n callbacks: {\n beforeNodeMorphed: element => !canRefreshFrame(element)\n }\n });\n\n for (const frame of currentElement.querySelectorAll(\"turbo-frame\")) {\n if (canRefreshFrame(frame)) frame.reload();\n }\n\n dispatch(\"turbo:morph\", { detail: { currentElement, newElement } });\n }\n\n async preservingPermanentElements(callback) {\n return await callback()\n }\n\n get renderMethod() {\n return \"morph\"\n }\n\n get shouldAutofocus() {\n return false\n }\n}\n\nfunction canRefreshFrame(frame) {\n return frame instanceof FrameElement &&\n frame.src &&\n frame.refresh === \"morph\" &&\n !frame.closest(\"[data-turbo-permanent]\")\n}\n\nclass SnapshotCache {\n keys = []\n snapshots = {}\n\n constructor(size) {\n this.size = size;\n }\n\n has(location) {\n return toCacheKey(location) in this.snapshots\n }\n\n get(location) {\n if (this.has(location)) {\n const snapshot = this.read(location);\n this.touch(location);\n return snapshot\n }\n }\n\n put(location, snapshot) {\n this.write(location, snapshot);\n this.touch(location);\n return snapshot\n }\n\n clear() {\n this.snapshots = {};\n }\n\n // Private\n\n read(location) {\n return this.snapshots[toCacheKey(location)]\n }\n\n write(location, snapshot) {\n this.snapshots[toCacheKey(location)] = snapshot;\n }\n\n touch(location) {\n const key = toCacheKey(location);\n const index = this.keys.indexOf(key);\n if (index > -1) this.keys.splice(index, 1);\n this.keys.unshift(key);\n this.trim();\n }\n\n trim() {\n for (const key of this.keys.splice(this.size)) {\n delete this.snapshots[key];\n }\n }\n}\n\nclass PageView extends View {\n snapshotCache = new SnapshotCache(10)\n lastRenderedLocation = new URL(location.href)\n forceReloaded = false\n\n shouldTransitionTo(newSnapshot) {\n return this.snapshot.prefersViewTransitions && newSnapshot.prefersViewTransitions\n }\n\n renderPage(snapshot, isPreview = false, willRender = true, visit) {\n const shouldMorphPage = this.isPageRefresh(visit) && this.snapshot.shouldMorphPage;\n const rendererClass = shouldMorphPage ? MorphingPageRenderer : PageRenderer;\n\n const renderer = new rendererClass(this.snapshot, snapshot, isPreview, willRender);\n\n if (!renderer.shouldRender) {\n this.forceReloaded = true;\n } else {\n visit?.changeHistory();\n }\n\n return this.render(renderer)\n }\n\n renderError(snapshot, visit) {\n visit?.changeHistory();\n const renderer = new ErrorRenderer(this.snapshot, snapshot, false);\n return this.render(renderer)\n }\n\n clearSnapshotCache() {\n this.snapshotCache.clear();\n }\n\n async cacheSnapshot(snapshot = this.snapshot) {\n if (snapshot.isCacheable) {\n this.delegate.viewWillCacheSnapshot();\n const { lastRenderedLocation: location } = this;\n await nextEventLoopTick();\n const cachedSnapshot = snapshot.clone();\n this.snapshotCache.put(location, cachedSnapshot);\n return cachedSnapshot\n }\n }\n\n getCachedSnapshotForLocation(location) {\n return this.snapshotCache.get(location)\n }\n\n isPageRefresh(visit) {\n return !visit || (this.lastRenderedLocation.pathname === visit.location.pathname && visit.action === \"replace\")\n }\n\n shouldPreserveScrollPosition(visit) {\n return this.isPageRefresh(visit) && this.snapshot.shouldPreserveScrollPosition\n }\n\n get snapshot() {\n return PageSnapshot.fromElement(this.element)\n }\n}\n\nclass Preloader {\n selector = \"a[data-turbo-preload]\"\n\n constructor(delegate, snapshotCache) {\n this.delegate = delegate;\n this.snapshotCache = snapshotCache;\n }\n\n start() {\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", this.#preloadAll);\n } else {\n this.preloadOnLoadLinksForView(document.body);\n }\n }\n\n stop() {\n document.removeEventListener(\"DOMContentLoaded\", this.#preloadAll);\n }\n\n preloadOnLoadLinksForView(element) {\n for (const link of element.querySelectorAll(this.selector)) {\n if (this.delegate.shouldPreloadLink(link)) {\n this.preloadURL(link);\n }\n }\n }\n\n async preloadURL(link) {\n const location = new URL(link.href);\n\n if (this.snapshotCache.has(location)) {\n return\n }\n\n const fetchRequest = new FetchRequest(this, FetchMethod.get, location, new URLSearchParams(), link);\n await fetchRequest.perform();\n }\n\n // Fetch request delegate\n\n prepareRequest(fetchRequest) {\n fetchRequest.headers[\"X-Sec-Purpose\"] = \"prefetch\";\n }\n\n async requestSucceededWithResponse(fetchRequest, fetchResponse) {\n try {\n const responseHTML = await fetchResponse.responseHTML;\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n\n this.snapshotCache.put(fetchRequest.url, snapshot);\n } catch (_) {\n // If we cannot preload that is ok!\n }\n }\n\n requestStarted(fetchRequest) {}\n\n requestErrored(fetchRequest) {}\n\n requestFinished(fetchRequest) {}\n\n requestPreventedHandlingResponse(fetchRequest, fetchResponse) {}\n\n requestFailedWithResponse(fetchRequest, fetchResponse) {}\n\n #preloadAll = () => {\n this.preloadOnLoadLinksForView(document.body);\n }\n}\n\nclass Cache {\n constructor(session) {\n this.session = session;\n }\n\n clear() {\n this.session.clearCache();\n }\n\n resetCacheControl() {\n this.#setCacheControl(\"\");\n }\n\n exemptPageFromCache() {\n this.#setCacheControl(\"no-cache\");\n }\n\n exemptPageFromPreview() {\n this.#setCacheControl(\"no-preview\");\n }\n\n #setCacheControl(value) {\n setMetaContent(\"turbo-cache-control\", value);\n }\n}\n\nclass Session {\n navigator = new Navigator(this)\n history = new History(this)\n view = new PageView(this, document.documentElement)\n adapter = new BrowserAdapter(this)\n\n pageObserver = new PageObserver(this)\n cacheObserver = new CacheObserver()\n linkPrefetchObserver = new LinkPrefetchObserver(this, document)\n linkClickObserver = new LinkClickObserver(this, window)\n formSubmitObserver = new FormSubmitObserver(this, document)\n scrollObserver = new ScrollObserver(this)\n streamObserver = new StreamObserver(this)\n formLinkClickObserver = new FormLinkClickObserver(this, document.documentElement)\n frameRedirector = new FrameRedirector(this, document.documentElement)\n streamMessageRenderer = new StreamMessageRenderer()\n cache = new Cache(this)\n\n enabled = true\n started = false\n #pageRefreshDebouncePeriod = 150\n\n constructor(recentRequests) {\n this.recentRequests = recentRequests;\n this.preloader = new Preloader(this, this.view.snapshotCache);\n this.debouncedRefresh = this.refresh;\n this.pageRefreshDebouncePeriod = this.pageRefreshDebouncePeriod;\n }\n\n start() {\n if (!this.started) {\n this.pageObserver.start();\n this.cacheObserver.start();\n this.linkPrefetchObserver.start();\n this.formLinkClickObserver.start();\n this.linkClickObserver.start();\n this.formSubmitObserver.start();\n this.scrollObserver.start();\n this.streamObserver.start();\n this.frameRedirector.start();\n this.history.start();\n this.preloader.start();\n this.started = true;\n this.enabled = true;\n }\n }\n\n disable() {\n this.enabled = false;\n }\n\n stop() {\n if (this.started) {\n this.pageObserver.stop();\n this.cacheObserver.stop();\n this.linkPrefetchObserver.stop();\n this.formLinkClickObserver.stop();\n this.linkClickObserver.stop();\n this.formSubmitObserver.stop();\n this.scrollObserver.stop();\n this.streamObserver.stop();\n this.frameRedirector.stop();\n this.history.stop();\n this.preloader.stop();\n this.started = false;\n }\n }\n\n registerAdapter(adapter) {\n this.adapter = adapter;\n }\n\n visit(location, options = {}) {\n const frameElement = options.frame ? document.getElementById(options.frame) : null;\n\n if (frameElement instanceof FrameElement) {\n const action = options.action || getVisitAction(frameElement);\n\n frameElement.delegate.proposeVisitIfNavigatedWithAction(frameElement, action);\n frameElement.src = location.toString();\n } else {\n this.navigator.proposeVisit(expandURL(location), options);\n }\n }\n\n refresh(url, requestId) {\n const isRecentRequest = requestId && this.recentRequests.has(requestId);\n if (!isRecentRequest && !this.navigator.currentVisit) {\n this.visit(url, { action: \"replace\", shouldCacheSnapshot: false });\n }\n }\n\n connectStreamSource(source) {\n this.streamObserver.connectStreamSource(source);\n }\n\n disconnectStreamSource(source) {\n this.streamObserver.disconnectStreamSource(source);\n }\n\n renderStreamMessage(message) {\n this.streamMessageRenderer.render(StreamMessage.wrap(message));\n }\n\n clearCache() {\n this.view.clearSnapshotCache();\n }\n\n setProgressBarDelay(delay) {\n console.warn(\n \"Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`\"\n );\n\n this.progressBarDelay = delay;\n }\n\n set progressBarDelay(delay) {\n config.drive.progressBarDelay = delay;\n }\n\n get progressBarDelay() {\n return config.drive.progressBarDelay\n }\n\n set drive(value) {\n config.drive.enabled = value;\n }\n\n get drive() {\n return config.drive.enabled\n }\n\n set formMode(value) {\n config.forms.mode = value;\n }\n\n get formMode() {\n return config.forms.mode\n }\n\n get location() {\n return this.history.location\n }\n\n get restorationIdentifier() {\n return this.history.restorationIdentifier\n }\n\n get pageRefreshDebouncePeriod() {\n return this.#pageRefreshDebouncePeriod\n }\n\n set pageRefreshDebouncePeriod(value) {\n this.refresh = debounce(this.debouncedRefresh.bind(this), value);\n this.#pageRefreshDebouncePeriod = value;\n }\n\n // Preloader delegate\n\n shouldPreloadLink(element) {\n const isUnsafe = element.hasAttribute(\"data-turbo-method\");\n const isStream = element.hasAttribute(\"data-turbo-stream\");\n const frameTarget = element.getAttribute(\"data-turbo-frame\");\n const frame = frameTarget == \"_top\" ?\n null :\n document.getElementById(frameTarget) || findClosestRecursively(element, \"turbo-frame:not([disabled])\");\n\n if (isUnsafe || isStream || frame instanceof FrameElement) {\n return false\n } else {\n const location = new URL(element.href);\n\n return this.elementIsNavigatable(element) && locationIsVisitable(location, this.snapshot.rootLocation)\n }\n }\n\n // History delegate\n\n historyPoppedToLocationWithRestorationIdentifierAndDirection(location, restorationIdentifier, direction) {\n if (this.enabled) {\n this.navigator.startVisit(location, restorationIdentifier, {\n action: \"restore\",\n historyChanged: true,\n direction\n });\n } else {\n this.adapter.pageInvalidated({\n reason: \"turbo_disabled\"\n });\n }\n }\n\n // Scroll observer delegate\n\n scrollPositionChanged(position) {\n this.history.updateRestorationData({ scrollPosition: position });\n }\n\n // Form click observer delegate\n\n willSubmitFormLinkToLocation(link, location) {\n return this.elementIsNavigatable(link) && locationIsVisitable(location, this.snapshot.rootLocation)\n }\n\n submittedFormLinkToLocation() {}\n\n // Link hover observer delegate\n\n canPrefetchRequestToLocation(link, location) {\n return (\n this.elementIsNavigatable(link) &&\n locationIsVisitable(location, this.snapshot.rootLocation)\n )\n }\n\n // Link click observer delegate\n\n willFollowLinkToLocation(link, location, event) {\n return (\n this.elementIsNavigatable(link) &&\n locationIsVisitable(location, this.snapshot.rootLocation) &&\n this.applicationAllowsFollowingLinkToLocation(link, location, event)\n )\n }\n\n followedLinkToLocation(link, location) {\n const action = this.getActionForLink(link);\n const acceptsStreamResponse = link.hasAttribute(\"data-turbo-stream\");\n\n this.visit(location.href, { action, acceptsStreamResponse });\n }\n\n // Navigator delegate\n\n allowsVisitingLocationWithAction(location, action) {\n return this.locationWithActionIsSamePage(location, action) || this.applicationAllowsVisitingLocation(location)\n }\n\n visitProposedToLocation(location, options) {\n extendURLWithDeprecatedProperties(location);\n this.adapter.visitProposedToLocation(location, options);\n }\n\n // Visit delegate\n\n visitStarted(visit) {\n if (!visit.acceptsStreamResponse) {\n markAsBusy(document.documentElement);\n this.view.markVisitDirection(visit.direction);\n }\n extendURLWithDeprecatedProperties(visit.location);\n if (!visit.silent) {\n this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);\n }\n }\n\n visitCompleted(visit) {\n this.view.unmarkVisitDirection();\n clearBusyState(document.documentElement);\n this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());\n }\n\n locationWithActionIsSamePage(location, action) {\n return this.navigator.locationWithActionIsSamePage(location, action)\n }\n\n visitScrolledToSamePageLocation(oldURL, newURL) {\n this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);\n }\n\n // Form submit observer delegate\n\n willSubmitForm(form, submitter) {\n const action = getAction$1(form, submitter);\n\n return (\n this.submissionIsNavigatable(form, submitter) &&\n locationIsVisitable(expandURL(action), this.snapshot.rootLocation)\n )\n }\n\n formSubmitted(form, submitter) {\n this.navigator.submitForm(form, submitter);\n }\n\n // Page observer delegate\n\n pageBecameInteractive() {\n this.view.lastRenderedLocation = this.location;\n this.notifyApplicationAfterPageLoad();\n }\n\n pageLoaded() {\n this.history.assumeControlOfScrollRestoration();\n }\n\n pageWillUnload() {\n this.history.relinquishControlOfScrollRestoration();\n }\n\n // Stream observer delegate\n\n receivedMessageFromStream(message) {\n this.renderStreamMessage(message);\n }\n\n // Page view delegate\n\n viewWillCacheSnapshot() {\n if (!this.navigator.currentVisit?.silent) {\n this.notifyApplicationBeforeCachingSnapshot();\n }\n }\n\n allowsImmediateRender({ element }, options) {\n const event = this.notifyApplicationBeforeRender(element, options);\n const {\n defaultPrevented,\n detail: { render }\n } = event;\n\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n\n return !defaultPrevented\n }\n\n viewRenderedSnapshot(_snapshot, _isPreview, renderMethod) {\n this.view.lastRenderedLocation = this.history.location;\n this.notifyApplicationAfterRender(renderMethod);\n }\n\n preloadOnLoadLinksForView(element) {\n this.preloader.preloadOnLoadLinksForView(element);\n }\n\n viewInvalidated(reason) {\n this.adapter.pageInvalidated(reason);\n }\n\n // Frame element\n\n frameLoaded(frame) {\n this.notifyApplicationAfterFrameLoad(frame);\n }\n\n frameRendered(fetchResponse, frame) {\n this.notifyApplicationAfterFrameRender(fetchResponse, frame);\n }\n\n // Application events\n\n applicationAllowsFollowingLinkToLocation(link, location, ev) {\n const event = this.notifyApplicationAfterClickingLinkToLocation(link, location, ev);\n return !event.defaultPrevented\n }\n\n applicationAllowsVisitingLocation(location) {\n const event = this.notifyApplicationBeforeVisitingLocation(location);\n return !event.defaultPrevented\n }\n\n notifyApplicationAfterClickingLinkToLocation(link, location, event) {\n return dispatch(\"turbo:click\", {\n target: link,\n detail: { url: location.href, originalEvent: event },\n cancelable: true\n })\n }\n\n notifyApplicationBeforeVisitingLocation(location) {\n return dispatch(\"turbo:before-visit\", {\n detail: { url: location.href },\n cancelable: true\n })\n }\n\n notifyApplicationAfterVisitingLocation(location, action) {\n return dispatch(\"turbo:visit\", { detail: { url: location.href, action } })\n }\n\n notifyApplicationBeforeCachingSnapshot() {\n return dispatch(\"turbo:before-cache\")\n }\n\n notifyApplicationBeforeRender(newBody, options) {\n return dispatch(\"turbo:before-render\", {\n detail: { newBody, ...options },\n cancelable: true\n })\n }\n\n notifyApplicationAfterRender(renderMethod) {\n return dispatch(\"turbo:render\", { detail: { renderMethod } })\n }\n\n notifyApplicationAfterPageLoad(timing = {}) {\n return dispatch(\"turbo:load\", {\n detail: { url: this.location.href, timing }\n })\n }\n\n notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL) {\n dispatchEvent(\n new HashChangeEvent(\"hashchange\", {\n oldURL: oldURL.toString(),\n newURL: newURL.toString()\n })\n );\n }\n\n notifyApplicationAfterFrameLoad(frame) {\n return dispatch(\"turbo:frame-load\", { target: frame })\n }\n\n notifyApplicationAfterFrameRender(fetchResponse, frame) {\n return dispatch(\"turbo:frame-render\", {\n detail: { fetchResponse },\n target: frame,\n cancelable: true\n })\n }\n\n // Helpers\n\n submissionIsNavigatable(form, submitter) {\n if (config.forms.mode == \"off\") {\n return false\n } else {\n const submitterIsNavigatable = submitter ? this.elementIsNavigatable(submitter) : true;\n\n if (config.forms.mode == \"optin\") {\n return submitterIsNavigatable && form.closest('[data-turbo=\"true\"]') != null\n } else {\n return submitterIsNavigatable && this.elementIsNavigatable(form)\n }\n }\n }\n\n elementIsNavigatable(element) {\n const container = findClosestRecursively(element, \"[data-turbo]\");\n const withinFrame = findClosestRecursively(element, \"turbo-frame\");\n\n // Check if Drive is enabled on the session or we're within a Frame.\n if (config.drive.enabled || withinFrame) {\n // Element is navigatable by default, unless `data-turbo=\"false\"`.\n if (container) {\n return container.getAttribute(\"data-turbo\") != \"false\"\n } else {\n return true\n }\n } else {\n // Element isn't navigatable by default, unless `data-turbo=\"true\"`.\n if (container) {\n return container.getAttribute(\"data-turbo\") == \"true\"\n } else {\n return false\n }\n }\n }\n\n // Private\n\n getActionForLink(link) {\n return getVisitAction(link) || \"advance\"\n }\n\n get snapshot() {\n return this.view.snapshot\n }\n}\n\n// Older versions of the Turbo Native adapters referenced the\n// `Location#absoluteURL` property in their implementations of\n// the `Adapter#visitProposedToLocation()` and `#visitStarted()`\n// methods. The Location class has since been removed in favor\n// of the DOM URL API, and accordingly all Adapter methods now\n// receive URL objects.\n//\n// We alias #absoluteURL to #toString() here to avoid crashing\n// older adapters which do not expect URL objects. We should\n// consider removing this support at some point in the future.\n\nfunction extendURLWithDeprecatedProperties(url) {\n Object.defineProperties(url, deprecatedLocationPropertyDescriptors);\n}\n\nconst deprecatedLocationPropertyDescriptors = {\n absoluteURL: {\n get() {\n return this.toString()\n }\n }\n};\n\nconst session = new Session(recentRequests);\nconst { cache, navigator: navigator$1 } = session;\n\n/**\n * Starts the main session.\n * This initialises any necessary observers such as those to monitor\n * link interactions.\n */\nfunction start() {\n session.start();\n}\n\n/**\n * Registers an adapter for the main session.\n *\n * @param adapter Adapter to register\n */\nfunction registerAdapter(adapter) {\n session.registerAdapter(adapter);\n}\n\n/**\n * Performs an application visit to the given location.\n *\n * @param location Location to visit (a URL or path)\n * @param options Options to apply\n * @param options.action Type of history navigation to apply (\"restore\",\n * \"replace\" or \"advance\")\n * @param options.historyChanged Specifies whether the browser history has\n * already been changed for this visit or not\n * @param options.referrer Specifies the referrer of this visit such that\n * navigations to the same page will not result in a new history entry.\n * @param options.snapshotHTML Cached snapshot to render\n * @param options.response Response of the specified location\n */\nfunction visit(location, options) {\n session.visit(location, options);\n}\n\n/**\n * Connects a stream source to the main session.\n *\n * @param source Stream source to connect\n */\nfunction connectStreamSource(source) {\n session.connectStreamSource(source);\n}\n\n/**\n * Disconnects a stream source from the main session.\n *\n * @param source Stream source to disconnect\n */\nfunction disconnectStreamSource(source) {\n session.disconnectStreamSource(source);\n}\n\n/**\n * Renders a stream message to the main session by appending it to the\n * current document.\n *\n * @param message Message to render\n */\nfunction renderStreamMessage(message) {\n session.renderStreamMessage(message);\n}\n\n/**\n * Removes all entries from the Turbo Drive page cache.\n * Call this when state has changed on the server that may affect cached pages.\n *\n * @deprecated since version 7.2.0 in favor of `Turbo.cache.clear()`\n */\nfunction clearCache() {\n console.warn(\n \"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n session.clearCache();\n}\n\n/**\n * Sets the delay after which the progress bar will appear during navigation.\n *\n * The progress bar appears after 500ms by default.\n *\n * Note that this method has no effect when used with the iOS or Android\n * adapters.\n *\n * @param delay Time to delay in milliseconds\n */\nfunction setProgressBarDelay(delay) {\n console.warn(\n \"Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n config.drive.progressBarDelay = delay;\n}\n\nfunction setConfirmMethod(confirmMethod) {\n console.warn(\n \"Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n config.forms.confirm = confirmMethod;\n}\n\nfunction setFormMode(mode) {\n console.warn(\n \"Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n config.forms.mode = mode;\n}\n\nvar Turbo = /*#__PURE__*/Object.freeze({\n __proto__: null,\n navigator: navigator$1,\n session: session,\n cache: cache,\n PageRenderer: PageRenderer,\n PageSnapshot: PageSnapshot,\n FrameRenderer: FrameRenderer,\n fetch: fetchWithTurboHeaders,\n config: config,\n start: start,\n registerAdapter: registerAdapter,\n visit: visit,\n connectStreamSource: connectStreamSource,\n disconnectStreamSource: disconnectStreamSource,\n renderStreamMessage: renderStreamMessage,\n clearCache: clearCache,\n setProgressBarDelay: setProgressBarDelay,\n setConfirmMethod: setConfirmMethod,\n setFormMode: setFormMode\n});\n\nclass TurboFrameMissingError extends Error {}\n\nclass FrameController {\n fetchResponseLoaded = (_fetchResponse) => Promise.resolve()\n #currentFetchRequest = null\n #resolveVisitPromise = () => {}\n #connected = false\n #hasBeenLoaded = false\n #ignoredAttributes = new Set()\n #shouldMorphFrame = false\n action = null\n\n constructor(element) {\n this.element = element;\n this.view = new FrameView(this, this.element);\n this.appearanceObserver = new AppearanceObserver(this, this.element);\n this.formLinkClickObserver = new FormLinkClickObserver(this, this.element);\n this.linkInterceptor = new LinkInterceptor(this, this.element);\n this.restorationIdentifier = uuid();\n this.formSubmitObserver = new FormSubmitObserver(this, this.element);\n }\n\n // Frame delegate\n\n connect() {\n if (!this.#connected) {\n this.#connected = true;\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n } else {\n this.#loadSourceURL();\n }\n this.formLinkClickObserver.start();\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\n }\n }\n\n disconnect() {\n if (this.#connected) {\n this.#connected = false;\n this.appearanceObserver.stop();\n this.formLinkClickObserver.stop();\n this.linkInterceptor.stop();\n this.formSubmitObserver.stop();\n }\n }\n\n disabledChanged() {\n if (this.loadingStyle == FrameLoadingStyle.eager) {\n this.#loadSourceURL();\n }\n }\n\n sourceURLChanged() {\n if (this.#isIgnoringChangesTo(\"src\")) return\n\n if (this.element.isConnected) {\n this.complete = false;\n }\n\n if (this.loadingStyle == FrameLoadingStyle.eager || this.#hasBeenLoaded) {\n this.#loadSourceURL();\n }\n }\n\n sourceURLReloaded() {\n const { refresh, src } = this.element;\n\n this.#shouldMorphFrame = src && refresh === \"morph\";\n\n this.element.removeAttribute(\"complete\");\n this.element.src = null;\n this.element.src = src;\n return this.element.loaded\n }\n\n loadingStyleChanged() {\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n } else {\n this.appearanceObserver.stop();\n this.#loadSourceURL();\n }\n }\n\n async #loadSourceURL() {\n if (this.enabled && this.isActive && !this.complete && this.sourceURL) {\n this.element.loaded = this.#visit(expandURL(this.sourceURL));\n this.appearanceObserver.stop();\n await this.element.loaded;\n this.#hasBeenLoaded = true;\n }\n }\n\n async loadResponse(fetchResponse) {\n if (fetchResponse.redirected || (fetchResponse.succeeded && fetchResponse.isHTML)) {\n this.sourceURL = fetchResponse.response.url;\n }\n\n try {\n const html = await fetchResponse.responseHTML;\n if (html) {\n const document = parseHTMLDocument(html);\n const pageSnapshot = PageSnapshot.fromDocument(document);\n\n if (pageSnapshot.isVisitable) {\n await this.#loadFrameResponse(fetchResponse, document);\n } else {\n await this.#handleUnvisitableFrameResponse(fetchResponse);\n }\n }\n } finally {\n this.#shouldMorphFrame = false;\n this.fetchResponseLoaded = () => Promise.resolve();\n }\n }\n\n // Appearance observer delegate\n\n elementAppearedInViewport(element) {\n this.proposeVisitIfNavigatedWithAction(element, getVisitAction(element));\n this.#loadSourceURL();\n }\n\n // Form link click observer delegate\n\n willSubmitFormLinkToLocation(link) {\n return this.#shouldInterceptNavigation(link)\n }\n\n submittedFormLinkToLocation(link, _location, form) {\n const frame = this.#findFrameElement(link);\n if (frame) form.setAttribute(\"data-turbo-frame\", frame.id);\n }\n\n // Link interceptor delegate\n\n shouldInterceptLinkClick(element, _location, _event) {\n return this.#shouldInterceptNavigation(element)\n }\n\n linkClickIntercepted(element, location) {\n this.#navigateFrame(element, location);\n }\n\n // Form submit observer delegate\n\n willSubmitForm(element, submitter) {\n return element.closest(\"turbo-frame\") == this.element && this.#shouldInterceptNavigation(element, submitter)\n }\n\n formSubmitted(element, submitter) {\n if (this.formSubmission) {\n this.formSubmission.stop();\n }\n\n this.formSubmission = new FormSubmission(this, element, submitter);\n const { fetchRequest } = this.formSubmission;\n this.prepareRequest(fetchRequest);\n this.formSubmission.start();\n }\n\n // Fetch request delegate\n\n prepareRequest(request) {\n request.headers[\"Turbo-Frame\"] = this.id;\n\n if (this.currentNavigationElement?.hasAttribute(\"data-turbo-stream\")) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n\n requestStarted(_request) {\n markAsBusy(this.element);\n }\n\n requestPreventedHandlingResponse(_request, _response) {\n this.#resolveVisitPromise();\n }\n\n async requestSucceededWithResponse(request, response) {\n await this.loadResponse(response);\n this.#resolveVisitPromise();\n }\n\n async requestFailedWithResponse(request, response) {\n await this.loadResponse(response);\n this.#resolveVisitPromise();\n }\n\n requestErrored(request, error) {\n console.error(error);\n this.#resolveVisitPromise();\n }\n\n requestFinished(_request) {\n clearBusyState(this.element);\n }\n\n // Form submission delegate\n\n formSubmissionStarted({ formElement }) {\n markAsBusy(formElement, this.#findFrameElement(formElement));\n }\n\n formSubmissionSucceededWithResponse(formSubmission, response) {\n const frame = this.#findFrameElement(formSubmission.formElement, formSubmission.submitter);\n\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, getVisitAction(formSubmission.submitter, formSubmission.formElement, frame));\n frame.delegate.loadResponse(response);\n\n if (!formSubmission.isSafe) {\n session.clearCache();\n }\n }\n\n formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n this.element.delegate.loadResponse(fetchResponse);\n session.clearCache();\n }\n\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n\n formSubmissionFinished({ formElement }) {\n clearBusyState(formElement, this.#findFrameElement(formElement));\n }\n\n // View delegate\n\n allowsImmediateRender({ element: newFrame }, options) {\n const event = dispatch(\"turbo:before-frame-render\", {\n target: this.element,\n detail: { newFrame, ...options },\n cancelable: true\n });\n\n const {\n defaultPrevented,\n detail: { render }\n } = event;\n\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n\n return !defaultPrevented\n }\n\n viewRenderedSnapshot(_snapshot, _isPreview, _renderMethod) {}\n\n preloadOnLoadLinksForView(element) {\n session.preloadOnLoadLinksForView(element);\n }\n\n viewInvalidated() {}\n\n // Frame renderer delegate\n\n willRenderFrame(currentElement, _newElement) {\n this.previousFrameElement = currentElement.cloneNode(true);\n }\n\n visitCachedSnapshot = ({ element }) => {\n const frame = element.querySelector(\"#\" + this.element.id);\n\n if (frame && this.previousFrameElement) {\n frame.replaceChildren(...this.previousFrameElement.children);\n }\n\n delete this.previousFrameElement;\n }\n\n // Private\n\n async #loadFrameResponse(fetchResponse, document) {\n const newFrameElement = await this.extractForeignFrameElement(document.body);\n const rendererClass = this.#shouldMorphFrame ? MorphingFrameRenderer : FrameRenderer;\n\n if (newFrameElement) {\n const snapshot = new Snapshot(newFrameElement);\n const renderer = new rendererClass(this, this.view.snapshot, snapshot, false, false);\n if (this.view.renderPromise) await this.view.renderPromise;\n this.changeHistory();\n\n await this.view.render(renderer);\n this.complete = true;\n session.frameRendered(fetchResponse, this.element);\n session.frameLoaded(this.element);\n await this.fetchResponseLoaded(fetchResponse);\n } else if (this.#willHandleFrameMissingFromResponse(fetchResponse)) {\n this.#handleFrameMissingFromResponse(fetchResponse);\n }\n }\n\n async #visit(url) {\n const request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element);\n\n this.#currentFetchRequest?.cancel();\n this.#currentFetchRequest = request;\n\n return new Promise((resolve) => {\n this.#resolveVisitPromise = () => {\n this.#resolveVisitPromise = () => {};\n this.#currentFetchRequest = null;\n resolve();\n };\n request.perform();\n })\n }\n\n #navigateFrame(element, url, submitter) {\n const frame = this.#findFrameElement(element, submitter);\n\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, getVisitAction(submitter, element, frame));\n\n this.#withCurrentNavigationElement(element, () => {\n frame.src = url;\n });\n }\n\n proposeVisitIfNavigatedWithAction(frame, action = null) {\n this.action = action;\n\n if (this.action) {\n const pageSnapshot = PageSnapshot.fromElement(frame).clone();\n const { visitCachedSnapshot } = frame.delegate;\n\n frame.delegate.fetchResponseLoaded = async (fetchResponse) => {\n if (frame.src) {\n const { statusCode, redirected } = fetchResponse;\n const responseHTML = await fetchResponse.responseHTML;\n const response = { statusCode, redirected, responseHTML };\n const options = {\n response,\n visitCachedSnapshot,\n willRender: false,\n updateHistory: false,\n restorationIdentifier: this.restorationIdentifier,\n snapshot: pageSnapshot\n };\n\n if (this.action) options.action = this.action;\n\n session.visit(frame.src, options);\n }\n };\n }\n }\n\n changeHistory() {\n if (this.action) {\n const method = getHistoryMethodForAction(this.action);\n session.history.update(method, expandURL(this.element.src || \"\"), this.restorationIdentifier);\n }\n }\n\n async #handleUnvisitableFrameResponse(fetchResponse) {\n console.warn(\n `The response (${fetchResponse.statusCode}) from <turbo-frame id=\"${this.element.id}\"> is performing a full page visit due to turbo-visit-control.`\n );\n\n await this.#visitResponse(fetchResponse.response);\n }\n\n #willHandleFrameMissingFromResponse(fetchResponse) {\n this.element.setAttribute(\"complete\", \"\");\n\n const response = fetchResponse.response;\n const visit = async (url, options) => {\n if (url instanceof Response) {\n this.#visitResponse(url);\n } else {\n session.visit(url, options);\n }\n };\n\n const event = dispatch(\"turbo:frame-missing\", {\n target: this.element,\n detail: { response, visit },\n cancelable: true\n });\n\n return !event.defaultPrevented\n }\n\n #handleFrameMissingFromResponse(fetchResponse) {\n this.view.missing();\n this.#throwFrameMissingError(fetchResponse);\n }\n\n #throwFrameMissingError(fetchResponse) {\n const message = `The response (${fetchResponse.statusCode}) did not contain the expected <turbo-frame id=\"${this.element.id}\"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;\n throw new TurboFrameMissingError(message)\n }\n\n async #visitResponse(response) {\n const wrapped = new FetchResponse(response);\n const responseHTML = await wrapped.responseHTML;\n const { location, redirected, statusCode } = wrapped;\n\n return session.visit(location, { response: { redirected, statusCode, responseHTML } })\n }\n\n #findFrameElement(element, submitter) {\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n return getFrameElementById(id) ?? this.element\n }\n\n async extractForeignFrameElement(container) {\n let element;\n const id = CSS.escape(this.id);\n\n try {\n element = activateElement(container.querySelector(`turbo-frame#${id}`), this.sourceURL);\n if (element) {\n return element\n }\n\n element = activateElement(container.querySelector(`turbo-frame[src][recurse~=${id}]`), this.sourceURL);\n if (element) {\n await element.loaded;\n return await this.extractForeignFrameElement(element)\n }\n } catch (error) {\n console.error(error);\n return new FrameElement()\n }\n\n return null\n }\n\n #formActionIsVisitable(form, submitter) {\n const action = getAction$1(form, submitter);\n\n return locationIsVisitable(expandURL(action), this.rootLocation)\n }\n\n #shouldInterceptNavigation(element, submitter) {\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n\n if (element instanceof HTMLFormElement && !this.#formActionIsVisitable(element, submitter)) {\n return false\n }\n\n if (!this.enabled || id == \"_top\") {\n return false\n }\n\n if (id) {\n const frameElement = getFrameElementById(id);\n if (frameElement) {\n return !frameElement.disabled\n }\n }\n\n if (!session.elementIsNavigatable(element)) {\n return false\n }\n\n if (submitter && !session.elementIsNavigatable(submitter)) {\n return false\n }\n\n return true\n }\n\n // Computed properties\n\n get id() {\n return this.element.id\n }\n\n get enabled() {\n return !this.element.disabled\n }\n\n get sourceURL() {\n if (this.element.src) {\n return this.element.src\n }\n }\n\n set sourceURL(sourceURL) {\n this.#ignoringChangesToAttribute(\"src\", () => {\n this.element.src = sourceURL ?? null;\n });\n }\n\n get loadingStyle() {\n return this.element.loading\n }\n\n get isLoading() {\n return this.formSubmission !== undefined || this.#resolveVisitPromise() !== undefined\n }\n\n get complete() {\n return this.element.hasAttribute(\"complete\")\n }\n\n set complete(value) {\n if (value) {\n this.element.setAttribute(\"complete\", \"\");\n } else {\n this.element.removeAttribute(\"complete\");\n }\n }\n\n get isActive() {\n return this.element.isActive && this.#connected\n }\n\n get rootLocation() {\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const root = meta?.content ?? \"/\";\n return expandURL(root)\n }\n\n #isIgnoringChangesTo(attributeName) {\n return this.#ignoredAttributes.has(attributeName)\n }\n\n #ignoringChangesToAttribute(attributeName, callback) {\n this.#ignoredAttributes.add(attributeName);\n callback();\n this.#ignoredAttributes.delete(attributeName);\n }\n\n #withCurrentNavigationElement(element, callback) {\n this.currentNavigationElement = element;\n callback();\n delete this.currentNavigationElement;\n }\n}\n\nfunction getFrameElementById(id) {\n if (id != null) {\n const element = document.getElementById(id);\n if (element instanceof FrameElement) {\n return element\n }\n }\n}\n\nfunction activateElement(element, currentURL) {\n if (element) {\n const src = element.getAttribute(\"src\");\n if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {\n throw new Error(`Matching <turbo-frame id=\"${element.id}\"> element has a source URL which references itself`)\n }\n if (element.ownerDocument !== document) {\n element = document.importNode(element, true);\n }\n\n if (element instanceof FrameElement) {\n element.connectedCallback();\n element.disconnectedCallback();\n return element\n }\n }\n}\n\nconst StreamActions = {\n after() {\n this.targetElements.forEach((e) => e.parentElement?.insertBefore(this.templateContent, e.nextSibling));\n },\n\n append() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach((e) => e.append(this.templateContent));\n },\n\n before() {\n this.targetElements.forEach((e) => e.parentElement?.insertBefore(this.templateContent, e));\n },\n\n prepend() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach((e) => e.prepend(this.templateContent));\n },\n\n remove() {\n this.targetElements.forEach((e) => e.remove());\n },\n\n replace() {\n const method = this.getAttribute(\"method\");\n\n this.targetElements.forEach((targetElement) => {\n if (method === \"morph\") {\n morphElements(targetElement, this.templateContent);\n } else {\n targetElement.replaceWith(this.templateContent);\n }\n });\n },\n\n update() {\n const method = this.getAttribute(\"method\");\n\n this.targetElements.forEach((targetElement) => {\n if (method === \"morph\") {\n morphChildren(targetElement, this.templateContent);\n } else {\n targetElement.innerHTML = \"\";\n targetElement.append(this.templateContent);\n }\n });\n },\n\n refresh() {\n session.refresh(this.baseURI, this.requestId);\n }\n};\n\n// <turbo-stream action=replace target=id><template>...\n\n/**\n * Renders updates to the page from a stream of messages.\n *\n * Using the `action` attribute, this can be configured one of eight ways:\n *\n * - `after` - inserts the result after the target\n * - `append` - appends the result to the target\n * - `before` - inserts the result before the target\n * - `prepend` - prepends the result to the target\n * - `refresh` - initiates a page refresh\n * - `remove` - removes the target\n * - `replace` - replaces the outer HTML of the target\n * - `update` - replaces the inner HTML of the target\n *\n * @customElement turbo-stream\n * @example\n * <turbo-stream action=\"append\" target=\"dom_id\">\n * <template>\n * Content to append to target designated with the dom_id.\n * </template>\n * </turbo-stream>\n */\nclass StreamElement extends HTMLElement {\n static async renderElement(newElement) {\n await newElement.performAction();\n }\n\n async connectedCallback() {\n try {\n await this.render();\n } catch (error) {\n console.error(error);\n } finally {\n this.disconnect();\n }\n }\n\n async render() {\n return (this.renderPromise ??= (async () => {\n const event = this.beforeRenderEvent;\n\n if (this.dispatchEvent(event)) {\n await nextRepaint();\n await event.detail.render(this);\n }\n })())\n }\n\n disconnect() {\n try {\n this.remove();\n // eslint-disable-next-line no-empty\n } catch {}\n }\n\n /**\n * Removes duplicate children (by ID)\n */\n removeDuplicateTargetChildren() {\n this.duplicateChildren.forEach((c) => c.remove());\n }\n\n /**\n * Gets the list of duplicate children (i.e. those with the same ID)\n */\n get duplicateChildren() {\n const existingChildren = this.targetElements.flatMap((e) => [...e.children]).filter((c) => !!c.id);\n const newChildrenIds = [...(this.templateContent?.children || [])].filter((c) => !!c.id).map((c) => c.id);\n\n return existingChildren.filter((c) => newChildrenIds.includes(c.id))\n }\n\n /**\n * Gets the action function to be performed.\n */\n get performAction() {\n if (this.action) {\n const actionFunction = StreamActions[this.action];\n if (actionFunction) {\n return actionFunction\n }\n this.#raise(\"unknown action\");\n }\n this.#raise(\"action attribute is missing\");\n }\n\n /**\n * Gets the target elements which the template will be rendered to.\n */\n get targetElements() {\n if (this.target) {\n return this.targetElementsById\n } else if (this.targets) {\n return this.targetElementsByQuery\n } else {\n this.#raise(\"target or targets attribute is missing\");\n }\n }\n\n /**\n * Gets the contents of the main `<template>`.\n */\n get templateContent() {\n return this.templateElement.content.cloneNode(true)\n }\n\n /**\n * Gets the main `<template>` used for rendering\n */\n get templateElement() {\n if (this.firstElementChild === null) {\n const template = this.ownerDocument.createElement(\"template\");\n this.appendChild(template);\n return template\n } else if (this.firstElementChild instanceof HTMLTemplateElement) {\n return this.firstElementChild\n }\n this.#raise(\"first child element must be a <template> element\");\n }\n\n /**\n * Gets the current action.\n */\n get action() {\n return this.getAttribute(\"action\")\n }\n\n /**\n * Gets the current target (an element ID) to which the result will\n * be rendered.\n */\n get target() {\n return this.getAttribute(\"target\")\n }\n\n /**\n * Gets the current \"targets\" selector (a CSS selector)\n */\n get targets() {\n return this.getAttribute(\"targets\")\n }\n\n /**\n * Reads the request-id attribute\n */\n get requestId() {\n return this.getAttribute(\"request-id\")\n }\n\n #raise(message) {\n throw new Error(`${this.description}: ${message}`)\n }\n\n get description() {\n return (this.outerHTML.match(/<[^>]+>/) ?? [])[0] ?? \"<turbo-stream>\"\n }\n\n get beforeRenderEvent() {\n return new CustomEvent(\"turbo:before-stream-render\", {\n bubbles: true,\n cancelable: true,\n detail: { newStream: this, render: StreamElement.renderElement }\n })\n }\n\n get targetElementsById() {\n const element = this.ownerDocument?.getElementById(this.target);\n\n if (element !== null) {\n return [element]\n } else {\n return []\n }\n }\n\n get targetElementsByQuery() {\n const elements = this.ownerDocument?.querySelectorAll(this.targets);\n\n if (elements.length !== 0) {\n return Array.prototype.slice.call(elements)\n } else {\n return []\n }\n }\n}\n\nclass StreamSourceElement extends HTMLElement {\n streamSource = null\n\n connectedCallback() {\n this.streamSource = this.src.match(/^ws{1,2}:/) ? new WebSocket(this.src) : new EventSource(this.src);\n\n connectStreamSource(this.streamSource);\n }\n\n disconnectedCallback() {\n if (this.streamSource) {\n this.streamSource.close();\n\n disconnectStreamSource(this.streamSource);\n }\n }\n\n get src() {\n return this.getAttribute(\"src\") || \"\"\n }\n}\n\nFrameElement.delegateConstructor = FrameController;\n\nif (customElements.get(\"turbo-frame\") === undefined) {\n customElements.define(\"turbo-frame\", FrameElement);\n}\n\nif (customElements.get(\"turbo-stream\") === undefined) {\n customElements.define(\"turbo-stream\", StreamElement);\n}\n\nif (customElements.get(\"turbo-stream-source\") === undefined) {\n customElements.define(\"turbo-stream-source\", StreamSourceElement);\n}\n\n(() => {\n let element = document.currentScript;\n if (!element) return\n if (element.hasAttribute(\"data-turbo-suppress-warning\")) return\n\n element = element.parentElement;\n while (element) {\n if (element == document.body) {\n return console.warn(\n unindent`\n You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!\n\n Load your application\u2019s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.\n\n For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements\n\n \u2014\u2014\n Suppress this warning by adding a \"data-turbo-suppress-warning\" attribute to: %s\n `,\n element.outerHTML\n )\n }\n\n element = element.parentElement;\n }\n})();\n\nwindow.Turbo = { ...Turbo, StreamActions };\nstart();\n\nexport { FetchEnctype, FetchMethod, FetchRequest, FetchResponse, FrameElement, FrameLoadingStyle, FrameRenderer, PageRenderer, PageSnapshot, StreamActions, StreamElement, StreamSourceElement, cache, clearCache, config, connectStreamSource, disconnectStreamSource, fetchWithTurboHeaders as fetch, fetchEnctypeFromString, fetchMethodFromString, isSafe, navigator$1 as navigator, registerAdapter, renderStreamMessage, session, setConfirmMethod, setFormMode, setProgressBarDelay, start, visit };\n", "let consumer\n\nexport async function getConsumer() {\n return consumer || setConsumer(createConsumer().then(setConsumer))\n}\n\nexport function setConsumer(newConsumer) {\n return consumer = newConsumer\n}\n\nexport async function createConsumer() {\n const { createConsumer } = await import(/* webpackChunkName: \"actioncable\" */ \"@rails/actioncable/src\")\n return createConsumer()\n}\n\nexport async function subscribeTo(channel, mixin) {\n const { subscriptions } = await getConsumer()\n return subscriptions.create(channel, mixin)\n}\n", "// Based on https://github.com/nathan7/snakeize\n//\n// This software is released under the MIT license:\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nexport default function walk (obj) {\n if (!obj || typeof obj !== 'object') return obj;\n if (obj instanceof Date || obj instanceof RegExp) return obj;\n if (Array.isArray(obj)) return obj.map(walk);\n return Object.keys(obj).reduce(function (acc, key) {\n var camel = key[0].toLowerCase() + key.slice(1).replace(/([A-Z]+)/g, function (m, x) {\n return '_' + x.toLowerCase();\n });\n acc[camel] = walk(obj[key]);\n return acc;\n }, {});\n};", "import { connectStreamSource, disconnectStreamSource } from \"@hotwired/turbo\"\nimport { subscribeTo } from \"./cable\"\nimport snakeize from \"./snakeize\"\n\nclass TurboCableStreamSourceElement extends HTMLElement {\n static observedAttributes = [\"channel\", \"signed-stream-name\"]\n\n async connectedCallback() {\n connectStreamSource(this)\n this.subscription = await subscribeTo(this.channel, {\n received: this.dispatchMessageEvent.bind(this),\n connected: this.subscriptionConnected.bind(this),\n disconnected: this.subscriptionDisconnected.bind(this)\n })\n }\n\n disconnectedCallback() {\n disconnectStreamSource(this)\n if (this.subscription) this.subscription.unsubscribe()\n this.subscriptionDisconnected()\n }\n\n attributeChangedCallback() {\n if (this.subscription) {\n this.disconnectedCallback()\n this.connectedCallback()\n }\n }\n\n dispatchMessageEvent(data) {\n const event = new MessageEvent(\"message\", { data })\n return this.dispatchEvent(event)\n }\n\n subscriptionConnected() {\n this.setAttribute(\"connected\", \"\")\n }\n\n subscriptionDisconnected() {\n this.removeAttribute(\"connected\")\n }\n\n get channel() {\n const channel = this.getAttribute(\"channel\")\n const signed_stream_name = this.getAttribute(\"signed-stream-name\")\n return { channel, signed_stream_name, ...snakeize({ ...this.dataset }) }\n }\n}\n\n\nif (customElements.get(\"turbo-cable-stream-source\") === undefined) {\n customElements.define(\"turbo-cable-stream-source\", TurboCableStreamSourceElement)\n}\n", "export function encodeMethodIntoRequestBody(event) {\n if (event.target instanceof HTMLFormElement) {\n const { target: form, detail: { fetchOptions } } = event\n\n form.addEventListener(\"turbo:submit-start\", ({ detail: { formSubmission: { submitter } } }) => {\n const body = isBodyInit(fetchOptions.body) ? fetchOptions.body : new URLSearchParams()\n const method = determineFetchMethod(submitter, body, form)\n\n if (!/get/i.test(method)) {\n if (/post/i.test(method)) {\n body.delete(\"_method\")\n } else {\n body.set(\"_method\", method)\n }\n\n fetchOptions.method = \"post\"\n }\n }, { once: true })\n }\n}\n\nfunction determineFetchMethod(submitter, body, form) {\n const formMethod = determineFormMethod(submitter)\n const overrideMethod = body.get(\"_method\")\n const method = form.getAttribute(\"method\") || \"get\"\n\n if (typeof formMethod == \"string\") {\n return formMethod\n } else if (typeof overrideMethod == \"string\") {\n return overrideMethod\n } else {\n return method\n }\n}\n\nfunction determineFormMethod(submitter) {\n if (submitter instanceof HTMLButtonElement || submitter instanceof HTMLInputElement) {\n // Rails 7 ActionView::Helpers::FormBuilder#button method has an override\n // for formmethod if the button does not have name or value attributes\n // set, which is the default. This means that if you use <%= f.button\n // formmethod: :delete %>, it will generate a <button name=\"_method\"\n // value=\"delete\" formmethod=\"post\">. Therefore, if the submitter's name\n // is already _method, it's value attribute already contains the desired\n // method.\n if (submitter.name === '_method') {\n return submitter.value\n } else if (submitter.hasAttribute(\"formmethod\")) {\n return submitter.formMethod\n } else {\n return null\n }\n } else {\n return null\n }\n}\n\nfunction isBodyInit(body) {\n return body instanceof FormData || body instanceof URLSearchParams\n}\n", "import \"./cable_stream_source_element\"\n\nimport * as Turbo from \"@hotwired/turbo\"\nexport { Turbo }\n\nimport * as cable from \"./cable\"\nexport { cable }\n\nimport { encodeMethodIntoRequestBody } from \"./fetch_requests\"\n\nwindow.Turbo = Turbo\n\naddEventListener(\"turbo:before-fetch-request\", encodeMethodIntoRequestBody)\n", "var sparkMd5 = {\n exports: {}\n};\n\n(function(module, exports) {\n (function(factory) {\n {\n module.exports = factory();\n }\n })((function(undefined$1) {\n var hex_chr = [ \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\" ];\n function md5cycle(x, k) {\n var a = x[0], b = x[1], c = x[2], d = x[3];\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n function md5blk(s) {\n var md5blks = [], i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n function md5blk_array(a) {\n var md5blks = [], i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n function md51(s) {\n var n = s.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function md51_array(a) {\n var n = a.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);\n length = a.length;\n tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function rhex(n) {\n var s = \"\", j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];\n }\n return s;\n }\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join(\"\");\n }\n if (hex(md51(\"hello\")) !== \"5d41402abc4b2a76b9719d911017c592\") ;\n if (typeof ArrayBuffer !== \"undefined\" && !ArrayBuffer.prototype.slice) {\n (function() {\n function clamp(val, length) {\n val = val | 0 || 0;\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n return Math.min(val, length);\n }\n ArrayBuffer.prototype.slice = function(from, to) {\n var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray;\n if (to !== undefined$1) {\n end = clamp(to, length);\n }\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n return target;\n };\n })();\n }\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n return str;\n }\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i;\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n return returnUInt8Array ? arr : buff;\n }\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n return returnUInt8Array ? result : result.buffer;\n }\n function hexToBinaryString(hex) {\n var bytes = [], length = hex.length, x;\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n return String.fromCharCode.apply(String, bytes);\n }\n function SparkMD5() {\n this.reset();\n }\n SparkMD5.prototype.append = function(str) {\n this.appendBinary(toUtf8(str));\n return this;\n };\n SparkMD5.prototype.appendBinary = function(contents) {\n this._buff += contents;\n this._length += contents.length;\n var length = this._buff.length, i;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n this._buff = this._buff.substring(i - 64);\n return this;\n };\n SparkMD5.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, i, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.prototype.reset = function() {\n this._buff = \"\";\n this._length = 0;\n this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n return this;\n };\n SparkMD5.prototype.getState = function() {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash.slice()\n };\n };\n SparkMD5.prototype.setState = function(state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n return this;\n };\n SparkMD5.prototype.destroy = function() {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n SparkMD5.prototype._finish = function(tail, length) {\n var i = length, tmp, lo, hi;\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n SparkMD5.hash = function(str, raw) {\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n SparkMD5.hashBinary = function(content, raw) {\n var hash = md51(content), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n SparkMD5.ArrayBuffer = function() {\n this.reset();\n };\n SparkMD5.ArrayBuffer.prototype.append = function(arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i;\n this._length += arr.byteLength;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], i, ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.ArrayBuffer.prototype.reset = function() {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.getState = function() {\n var state = SparkMD5.prototype.getState.call(this);\n state.buff = arrayBuffer2Utf8Str(state.buff);\n return state;\n };\n SparkMD5.ArrayBuffer.prototype.setState = function(state) {\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n return SparkMD5.prototype.setState.call(this, state);\n };\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n SparkMD5.ArrayBuffer.hash = function(arr, raw) {\n var hash = md51_array(new Uint8Array(arr)), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n return SparkMD5;\n }));\n})(sparkMd5);\n\nvar SparkMD5 = sparkMd5.exports;\n\nconst fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;\n\nclass FileChecksum {\n static create(file, callback) {\n const instance = new FileChecksum(file);\n instance.create(callback);\n }\n constructor(file) {\n this.file = file;\n this.chunkSize = 2097152;\n this.chunkCount = Math.ceil(this.file.size / this.chunkSize);\n this.chunkIndex = 0;\n }\n create(callback) {\n this.callback = callback;\n this.md5Buffer = new SparkMD5.ArrayBuffer;\n this.fileReader = new FileReader;\n this.fileReader.addEventListener(\"load\", (event => this.fileReaderDidLoad(event)));\n this.fileReader.addEventListener(\"error\", (event => this.fileReaderDidError(event)));\n this.readNextChunk();\n }\n fileReaderDidLoad(event) {\n this.md5Buffer.append(event.target.result);\n if (!this.readNextChunk()) {\n const binaryDigest = this.md5Buffer.end(true);\n const base64digest = btoa(binaryDigest);\n this.callback(null, base64digest);\n }\n }\n fileReaderDidError(event) {\n this.callback(`Error reading ${this.file.name}`);\n }\n readNextChunk() {\n if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {\n const start = this.chunkIndex * this.chunkSize;\n const end = Math.min(start + this.chunkSize, this.file.size);\n const bytes = fileSlice.call(this.file, start, end);\n this.fileReader.readAsArrayBuffer(bytes);\n this.chunkIndex++;\n return true;\n } else {\n return false;\n }\n }\n}\n\nfunction getMetaValue(name) {\n const element = findElement(document.head, `meta[name=\"${name}\"]`);\n if (element) {\n return element.getAttribute(\"content\");\n }\n}\n\nfunction findElements(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n const elements = root.querySelectorAll(selector);\n return toArray(elements);\n}\n\nfunction findElement(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n return root.querySelector(selector);\n}\n\nfunction dispatchEvent(element, type, eventInit = {}) {\n const {disabled: disabled} = element;\n const {bubbles: bubbles, cancelable: cancelable, detail: detail} = eventInit;\n const event = document.createEvent(\"Event\");\n event.initEvent(type, bubbles || true, cancelable || true);\n event.detail = detail || {};\n try {\n element.disabled = false;\n element.dispatchEvent(event);\n } finally {\n element.disabled = disabled;\n }\n return event;\n}\n\nfunction toArray(value) {\n if (Array.isArray(value)) {\n return value;\n } else if (Array.from) {\n return Array.from(value);\n } else {\n return [].slice.call(value);\n }\n}\n\nclass BlobRecord {\n constructor(file, checksum, url, customHeaders = {}) {\n this.file = file;\n this.attributes = {\n filename: file.name,\n content_type: file.type || \"application/octet-stream\",\n byte_size: file.size,\n checksum: checksum\n };\n this.xhr = new XMLHttpRequest;\n this.xhr.open(\"POST\", url, true);\n this.xhr.responseType = \"json\";\n this.xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n this.xhr.setRequestHeader(\"Accept\", \"application/json\");\n this.xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n Object.keys(customHeaders).forEach((headerKey => {\n this.xhr.setRequestHeader(headerKey, customHeaders[headerKey]);\n }));\n const csrfToken = getMetaValue(\"csrf-token\");\n if (csrfToken != undefined) {\n this.xhr.setRequestHeader(\"X-CSRF-Token\", csrfToken);\n }\n this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n }\n get status() {\n return this.xhr.status;\n }\n get response() {\n const {responseType: responseType, response: response} = this.xhr;\n if (responseType == \"json\") {\n return response;\n } else {\n return JSON.parse(response);\n }\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(JSON.stringify({\n blob: this.attributes\n }));\n }\n requestDidLoad(event) {\n if (this.status >= 200 && this.status < 300) {\n const {response: response} = this;\n const {direct_upload: direct_upload} = response;\n delete response.direct_upload;\n this.attributes = response;\n this.directUploadData = direct_upload;\n this.callback(null, this.toJSON());\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error creating Blob for \"${this.file.name}\". Status: ${this.status}`);\n }\n toJSON() {\n const result = {};\n for (const key in this.attributes) {\n result[key] = this.attributes[key];\n }\n return result;\n }\n}\n\nclass BlobUpload {\n constructor(blob) {\n this.blob = blob;\n this.file = blob.file;\n const {url: url, headers: headers} = blob.directUploadData;\n this.xhr = new XMLHttpRequest;\n this.xhr.open(\"PUT\", url, true);\n this.xhr.responseType = \"text\";\n for (const key in headers) {\n this.xhr.setRequestHeader(key, headers[key]);\n }\n this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(this.file.slice());\n }\n requestDidLoad(event) {\n const {status: status, response: response} = this.xhr;\n if (status >= 200 && status < 300) {\n this.callback(null, response);\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error storing \"${this.file.name}\". Status: ${this.xhr.status}`);\n }\n}\n\nlet id = 0;\n\nclass DirectUpload {\n constructor(file, url, delegate, customHeaders = {}) {\n this.id = ++id;\n this.file = file;\n this.url = url;\n this.delegate = delegate;\n this.customHeaders = customHeaders;\n }\n create(callback) {\n FileChecksum.create(this.file, ((error, checksum) => {\n if (error) {\n callback(error);\n return;\n }\n const blob = new BlobRecord(this.file, checksum, this.url, this.customHeaders);\n notify(this.delegate, \"directUploadWillCreateBlobWithXHR\", blob.xhr);\n blob.create((error => {\n if (error) {\n callback(error);\n } else {\n const upload = new BlobUpload(blob);\n notify(this.delegate, \"directUploadWillStoreFileWithXHR\", upload.xhr);\n upload.create((error => {\n if (error) {\n callback(error);\n } else {\n callback(null, blob.toJSON());\n }\n }));\n }\n }));\n }));\n }\n}\n\nfunction notify(object, methodName, ...messages) {\n if (object && typeof object[methodName] == \"function\") {\n return object[methodName](...messages);\n }\n}\n\nclass DirectUploadController {\n constructor(input, file) {\n this.input = input;\n this.file = file;\n this.directUpload = new DirectUpload(this.file, this.url, this);\n this.dispatch(\"initialize\");\n }\n start(callback) {\n const hiddenInput = document.createElement(\"input\");\n hiddenInput.type = \"hidden\";\n hiddenInput.name = this.input.name;\n this.input.insertAdjacentElement(\"beforebegin\", hiddenInput);\n this.dispatch(\"start\");\n this.directUpload.create(((error, attributes) => {\n if (error) {\n hiddenInput.parentNode.removeChild(hiddenInput);\n this.dispatchError(error);\n } else {\n hiddenInput.value = attributes.signed_id;\n }\n this.dispatch(\"end\");\n callback(error);\n }));\n }\n uploadRequestDidProgress(event) {\n const progress = event.loaded / event.total * 100;\n if (progress) {\n this.dispatch(\"progress\", {\n progress: progress\n });\n }\n }\n get url() {\n return this.input.getAttribute(\"data-direct-upload-url\");\n }\n dispatch(name, detail = {}) {\n detail.file = this.file;\n detail.id = this.directUpload.id;\n return dispatchEvent(this.input, `direct-upload:${name}`, {\n detail: detail\n });\n }\n dispatchError(error) {\n const event = this.dispatch(\"error\", {\n error: error\n });\n if (!event.defaultPrevented) {\n alert(error);\n }\n }\n directUploadWillCreateBlobWithXHR(xhr) {\n this.dispatch(\"before-blob-request\", {\n xhr: xhr\n });\n }\n directUploadWillStoreFileWithXHR(xhr) {\n this.dispatch(\"before-storage-request\", {\n xhr: xhr\n });\n xhr.upload.addEventListener(\"progress\", (event => this.uploadRequestDidProgress(event)));\n }\n}\n\nconst inputSelector = \"input[type=file][data-direct-upload-url]:not([disabled])\";\n\nclass DirectUploadsController {\n constructor(form) {\n this.form = form;\n this.inputs = findElements(form, inputSelector).filter((input => input.files.length));\n }\n start(callback) {\n const controllers = this.createDirectUploadControllers();\n const startNextController = () => {\n const controller = controllers.shift();\n if (controller) {\n controller.start((error => {\n if (error) {\n callback(error);\n this.dispatch(\"end\");\n } else {\n startNextController();\n }\n }));\n } else {\n callback();\n this.dispatch(\"end\");\n }\n };\n this.dispatch(\"start\");\n startNextController();\n }\n createDirectUploadControllers() {\n const controllers = [];\n this.inputs.forEach((input => {\n toArray(input.files).forEach((file => {\n const controller = new DirectUploadController(input, file);\n controllers.push(controller);\n }));\n }));\n return controllers;\n }\n dispatch(name, detail = {}) {\n return dispatchEvent(this.form, `direct-uploads:${name}`, {\n detail: detail\n });\n }\n}\n\nconst processingAttribute = \"data-direct-uploads-processing\";\n\nconst submitButtonsByForm = new WeakMap;\n\nlet started = false;\n\nfunction start() {\n if (!started) {\n started = true;\n document.addEventListener(\"click\", didClick, true);\n document.addEventListener(\"submit\", didSubmitForm, true);\n document.addEventListener(\"ajax:before\", didSubmitRemoteElement);\n }\n}\n\nfunction didClick(event) {\n const button = event.target.closest(\"button, input\");\n if (button && button.type === \"submit\" && button.form) {\n submitButtonsByForm.set(button.form, button);\n }\n}\n\nfunction didSubmitForm(event) {\n handleFormSubmissionEvent(event);\n}\n\nfunction didSubmitRemoteElement(event) {\n if (event.target.tagName == \"FORM\") {\n handleFormSubmissionEvent(event);\n }\n}\n\nfunction handleFormSubmissionEvent(event) {\n const form = event.target;\n if (form.hasAttribute(processingAttribute)) {\n event.preventDefault();\n return;\n }\n const controller = new DirectUploadsController(form);\n const {inputs: inputs} = controller;\n if (inputs.length) {\n event.preventDefault();\n form.setAttribute(processingAttribute, \"\");\n inputs.forEach(disable);\n controller.start((error => {\n form.removeAttribute(processingAttribute);\n if (error) {\n inputs.forEach(enable);\n } else {\n submitForm(form);\n }\n }));\n }\n}\n\nfunction submitForm(form) {\n let button = submitButtonsByForm.get(form) || findElement(form, \"input[type=submit], button[type=submit]\");\n if (button) {\n const {disabled: disabled} = button;\n button.disabled = false;\n button.focus();\n button.click();\n button.disabled = disabled;\n } else {\n button = document.createElement(\"input\");\n button.type = \"submit\";\n button.style.display = \"none\";\n form.appendChild(button);\n button.click();\n form.removeChild(button);\n }\n submitButtonsByForm.delete(form);\n}\n\nfunction disable(input) {\n input.disabled = true;\n}\n\nfunction enable(input) {\n input.disabled = false;\n}\n\nfunction autostart() {\n if (window.ActiveStorage) {\n start();\n }\n}\n\nsetTimeout(autostart, 1);\n\nexport { DirectUpload, DirectUploadController, DirectUploadsController, start };\n", "/*\nStimulus 3.2.1\nCopyright \u00A9 2023 Basecamp, LLC\n */\nclass EventListener {\n constructor(eventTarget, eventName, eventOptions) {\n this.eventTarget = eventTarget;\n this.eventName = eventName;\n this.eventOptions = eventOptions;\n this.unorderedBindings = new Set();\n }\n connect() {\n this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n }\n disconnect() {\n this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n }\n bindingConnected(binding) {\n this.unorderedBindings.add(binding);\n }\n bindingDisconnected(binding) {\n this.unorderedBindings.delete(binding);\n }\n handleEvent(event) {\n const extendedEvent = extendEvent(event);\n for (const binding of this.bindings) {\n if (extendedEvent.immediatePropagationStopped) {\n break;\n }\n else {\n binding.handleEvent(extendedEvent);\n }\n }\n }\n hasBindings() {\n return this.unorderedBindings.size > 0;\n }\n get bindings() {\n return Array.from(this.unorderedBindings).sort((left, right) => {\n const leftIndex = left.index, rightIndex = right.index;\n return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n });\n }\n}\nfunction extendEvent(event) {\n if (\"immediatePropagationStopped\" in event) {\n return event;\n }\n else {\n const { stopImmediatePropagation } = event;\n return Object.assign(event, {\n immediatePropagationStopped: false,\n stopImmediatePropagation() {\n this.immediatePropagationStopped = true;\n stopImmediatePropagation.call(this);\n },\n });\n }\n}\n\nclass Dispatcher {\n constructor(application) {\n this.application = application;\n this.eventListenerMaps = new Map();\n this.started = false;\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.eventListeners.forEach((eventListener) => eventListener.connect());\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n this.eventListeners.forEach((eventListener) => eventListener.disconnect());\n }\n }\n get eventListeners() {\n return Array.from(this.eventListenerMaps.values()).reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n }\n bindingConnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n }\n bindingDisconnected(binding, clearEventListeners = false) {\n this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n if (clearEventListeners)\n this.clearEventListenersForBinding(binding);\n }\n handleError(error, message, detail = {}) {\n this.application.handleError(error, `Error ${message}`, detail);\n }\n clearEventListenersForBinding(binding) {\n const eventListener = this.fetchEventListenerForBinding(binding);\n if (!eventListener.hasBindings()) {\n eventListener.disconnect();\n this.removeMappedEventListenerFor(binding);\n }\n }\n removeMappedEventListenerFor(binding) {\n const { eventTarget, eventName, eventOptions } = binding;\n const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n const cacheKey = this.cacheKey(eventName, eventOptions);\n eventListenerMap.delete(cacheKey);\n if (eventListenerMap.size == 0)\n this.eventListenerMaps.delete(eventTarget);\n }\n fetchEventListenerForBinding(binding) {\n const { eventTarget, eventName, eventOptions } = binding;\n return this.fetchEventListener(eventTarget, eventName, eventOptions);\n }\n fetchEventListener(eventTarget, eventName, eventOptions) {\n const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n const cacheKey = this.cacheKey(eventName, eventOptions);\n let eventListener = eventListenerMap.get(cacheKey);\n if (!eventListener) {\n eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n eventListenerMap.set(cacheKey, eventListener);\n }\n return eventListener;\n }\n createEventListener(eventTarget, eventName, eventOptions) {\n const eventListener = new EventListener(eventTarget, eventName, eventOptions);\n if (this.started) {\n eventListener.connect();\n }\n return eventListener;\n }\n fetchEventListenerMapForEventTarget(eventTarget) {\n let eventListenerMap = this.eventListenerMaps.get(eventTarget);\n if (!eventListenerMap) {\n eventListenerMap = new Map();\n this.eventListenerMaps.set(eventTarget, eventListenerMap);\n }\n return eventListenerMap;\n }\n cacheKey(eventName, eventOptions) {\n const parts = [eventName];\n Object.keys(eventOptions)\n .sort()\n .forEach((key) => {\n parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n });\n return parts.join(\":\");\n }\n}\n\nconst defaultActionDescriptorFilters = {\n stop({ event, value }) {\n if (value)\n event.stopPropagation();\n return true;\n },\n prevent({ event, value }) {\n if (value)\n event.preventDefault();\n return true;\n },\n self({ event, value, element }) {\n if (value) {\n return element === event.target;\n }\n else {\n return true;\n }\n },\n};\nconst descriptorPattern = /^(?:(?:([^.]+?)\\+)?(.+?)(?:\\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n const source = descriptorString.trim();\n const matches = source.match(descriptorPattern) || [];\n let eventName = matches[2];\n let keyFilter = matches[3];\n if (keyFilter && ![\"keydown\", \"keyup\", \"keypress\"].includes(eventName)) {\n eventName += `.${keyFilter}`;\n keyFilter = \"\";\n }\n return {\n eventTarget: parseEventTarget(matches[4]),\n eventName,\n eventOptions: matches[7] ? parseEventOptions(matches[7]) : {},\n identifier: matches[5],\n methodName: matches[6],\n keyFilter: matches[1] || keyFilter,\n };\n}\nfunction parseEventTarget(eventTargetName) {\n if (eventTargetName == \"window\") {\n return window;\n }\n else if (eventTargetName == \"document\") {\n return document;\n }\n}\nfunction parseEventOptions(eventOptions) {\n return eventOptions\n .split(\":\")\n .reduce((options, token) => Object.assign(options, { [token.replace(/^!/, \"\")]: !/^!/.test(token) }), {});\n}\nfunction stringifyEventTarget(eventTarget) {\n if (eventTarget == window) {\n return \"window\";\n }\n else if (eventTarget == document) {\n return \"document\";\n }\n}\n\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\nfunction namespaceCamelize(value) {\n return camelize(value.replace(/--/g, \"-\").replace(/__/g, \"_\"));\n}\nfunction capitalize(value) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\nfunction tokenize(value) {\n return value.match(/[^\\s]+/g) || [];\n}\n\nfunction isSomething(object) {\n return object !== null && object !== undefined;\n}\nfunction hasProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nconst allModifiers = [\"meta\", \"ctrl\", \"alt\", \"shift\"];\nclass Action {\n constructor(element, index, descriptor, schema) {\n this.element = element;\n this.index = index;\n this.eventTarget = descriptor.eventTarget || element;\n this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n this.eventOptions = descriptor.eventOptions || {};\n this.identifier = descriptor.identifier || error(\"missing identifier\");\n this.methodName = descriptor.methodName || error(\"missing method name\");\n this.keyFilter = descriptor.keyFilter || \"\";\n this.schema = schema;\n }\n static forToken(token, schema) {\n return new this(token.element, token.index, parseActionDescriptorString(token.content), schema);\n }\n toString() {\n const eventFilter = this.keyFilter ? `.${this.keyFilter}` : \"\";\n const eventTarget = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n return `${this.eventName}${eventFilter}${eventTarget}->${this.identifier}#${this.methodName}`;\n }\n shouldIgnoreKeyboardEvent(event) {\n if (!this.keyFilter) {\n return false;\n }\n const filters = this.keyFilter.split(\"+\");\n if (this.keyFilterDissatisfied(event, filters)) {\n return true;\n }\n const standardFilter = filters.filter((key) => !allModifiers.includes(key))[0];\n if (!standardFilter) {\n return false;\n }\n if (!hasProperty(this.keyMappings, standardFilter)) {\n error(`contains unknown key filter: ${this.keyFilter}`);\n }\n return this.keyMappings[standardFilter].toLowerCase() !== event.key.toLowerCase();\n }\n shouldIgnoreMouseEvent(event) {\n if (!this.keyFilter) {\n return false;\n }\n const filters = [this.keyFilter];\n if (this.keyFilterDissatisfied(event, filters)) {\n return true;\n }\n return false;\n }\n get params() {\n const params = {};\n const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`, \"i\");\n for (const { name, value } of Array.from(this.element.attributes)) {\n const match = name.match(pattern);\n const key = match && match[1];\n if (key) {\n params[camelize(key)] = typecast(value);\n }\n }\n return params;\n }\n get eventTargetName() {\n return stringifyEventTarget(this.eventTarget);\n }\n get keyMappings() {\n return this.schema.keyMappings;\n }\n keyFilterDissatisfied(event, filters) {\n const [meta, ctrl, alt, shift] = allModifiers.map((modifier) => filters.includes(modifier));\n return event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== alt || event.shiftKey !== shift;\n }\n}\nconst defaultEventNames = {\n a: () => \"click\",\n button: () => \"click\",\n form: () => \"submit\",\n details: () => \"toggle\",\n input: (e) => (e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\"),\n select: () => \"change\",\n textarea: () => \"input\",\n};\nfunction getDefaultEventNameForElement(element) {\n const tagName = element.tagName.toLowerCase();\n if (tagName in defaultEventNames) {\n return defaultEventNames[tagName](element);\n }\n}\nfunction error(message) {\n throw new Error(message);\n}\nfunction typecast(value) {\n try {\n return JSON.parse(value);\n }\n catch (o_O) {\n return value;\n }\n}\n\nclass Binding {\n constructor(context, action) {\n this.context = context;\n this.action = action;\n }\n get index() {\n return this.action.index;\n }\n get eventTarget() {\n return this.action.eventTarget;\n }\n get eventOptions() {\n return this.action.eventOptions;\n }\n get identifier() {\n return this.context.identifier;\n }\n handleEvent(event) {\n const actionEvent = this.prepareActionEvent(event);\n if (this.willBeInvokedByEvent(event) && this.applyEventModifiers(actionEvent)) {\n this.invokeWithEvent(actionEvent);\n }\n }\n get eventName() {\n return this.action.eventName;\n }\n get method() {\n const method = this.controller[this.methodName];\n if (typeof method == \"function\") {\n return method;\n }\n throw new Error(`Action \"${this.action}\" references undefined method \"${this.methodName}\"`);\n }\n applyEventModifiers(event) {\n const { element } = this.action;\n const { actionDescriptorFilters } = this.context.application;\n const { controller } = this.context;\n let passes = true;\n for (const [name, value] of Object.entries(this.eventOptions)) {\n if (name in actionDescriptorFilters) {\n const filter = actionDescriptorFilters[name];\n passes = passes && filter({ name, value, event, element, controller });\n }\n else {\n continue;\n }\n }\n return passes;\n }\n prepareActionEvent(event) {\n return Object.assign(event, { params: this.action.params });\n }\n invokeWithEvent(event) {\n const { target, currentTarget } = event;\n try {\n this.method.call(this.controller, event);\n this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName });\n }\n catch (error) {\n const { identifier, controller, element, index } = this;\n const detail = { identifier, controller, element, index, event };\n this.context.handleError(error, `invoking action \"${this.action}\"`, detail);\n }\n }\n willBeInvokedByEvent(event) {\n const eventTarget = event.target;\n if (event instanceof KeyboardEvent && this.action.shouldIgnoreKeyboardEvent(event)) {\n return false;\n }\n if (event instanceof MouseEvent && this.action.shouldIgnoreMouseEvent(event)) {\n return false;\n }\n if (this.element === eventTarget) {\n return true;\n }\n else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n return this.scope.containsElement(eventTarget);\n }\n else {\n return this.scope.containsElement(this.action.element);\n }\n }\n get controller() {\n return this.context.controller;\n }\n get methodName() {\n return this.action.methodName;\n }\n get element() {\n return this.scope.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nclass ElementObserver {\n constructor(element, delegate) {\n this.mutationObserverInit = { attributes: true, childList: true, subtree: true };\n this.element = element;\n this.started = false;\n this.delegate = delegate;\n this.elements = new Set();\n this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.refresh();\n }\n }\n pause(callback) {\n if (this.started) {\n this.mutationObserver.disconnect();\n this.started = false;\n }\n callback();\n if (!this.started) {\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n const matches = new Set(this.matchElementsInTree());\n for (const element of Array.from(this.elements)) {\n if (!matches.has(element)) {\n this.removeElement(element);\n }\n }\n for (const element of Array.from(matches)) {\n this.addElement(element);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n if (mutation.type == \"attributes\") {\n this.processAttributeChange(mutation.target, mutation.attributeName);\n }\n else if (mutation.type == \"childList\") {\n this.processRemovedNodes(mutation.removedNodes);\n this.processAddedNodes(mutation.addedNodes);\n }\n }\n processAttributeChange(element, attributeName) {\n if (this.elements.has(element)) {\n if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n this.delegate.elementAttributeChanged(element, attributeName);\n }\n else {\n this.removeElement(element);\n }\n }\n else if (this.matchElement(element)) {\n this.addElement(element);\n }\n }\n processRemovedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element) {\n this.processTree(element, this.removeElement);\n }\n }\n }\n processAddedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element && this.elementIsActive(element)) {\n this.processTree(element, this.addElement);\n }\n }\n }\n matchElement(element) {\n return this.delegate.matchElement(element);\n }\n matchElementsInTree(tree = this.element) {\n return this.delegate.matchElementsInTree(tree);\n }\n processTree(tree, processor) {\n for (const element of this.matchElementsInTree(tree)) {\n processor.call(this, element);\n }\n }\n elementFromNode(node) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n return node;\n }\n }\n elementIsActive(element) {\n if (element.isConnected != this.element.isConnected) {\n return false;\n }\n else {\n return this.element.contains(element);\n }\n }\n addElement(element) {\n if (!this.elements.has(element)) {\n if (this.elementIsActive(element)) {\n this.elements.add(element);\n if (this.delegate.elementMatched) {\n this.delegate.elementMatched(element);\n }\n }\n }\n }\n removeElement(element) {\n if (this.elements.has(element)) {\n this.elements.delete(element);\n if (this.delegate.elementUnmatched) {\n this.delegate.elementUnmatched(element);\n }\n }\n }\n}\n\nclass AttributeObserver {\n constructor(element, attributeName, delegate) {\n this.attributeName = attributeName;\n this.delegate = delegate;\n this.elementObserver = new ElementObserver(element, this);\n }\n get element() {\n return this.elementObserver.element;\n }\n get selector() {\n return `[${this.attributeName}]`;\n }\n start() {\n this.elementObserver.start();\n }\n pause(callback) {\n this.elementObserver.pause(callback);\n }\n stop() {\n this.elementObserver.stop();\n }\n refresh() {\n this.elementObserver.refresh();\n }\n get started() {\n return this.elementObserver.started;\n }\n matchElement(element) {\n return element.hasAttribute(this.attributeName);\n }\n matchElementsInTree(tree) {\n const match = this.matchElement(tree) ? [tree] : [];\n const matches = Array.from(tree.querySelectorAll(this.selector));\n return match.concat(matches);\n }\n elementMatched(element) {\n if (this.delegate.elementMatchedAttribute) {\n this.delegate.elementMatchedAttribute(element, this.attributeName);\n }\n }\n elementUnmatched(element) {\n if (this.delegate.elementUnmatchedAttribute) {\n this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n }\n }\n elementAttributeChanged(element, attributeName) {\n if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n this.delegate.elementAttributeValueChanged(element, attributeName);\n }\n }\n}\n\nfunction add(map, key, value) {\n fetch(map, key).add(value);\n}\nfunction del(map, key, value) {\n fetch(map, key).delete(value);\n prune(map, key);\n}\nfunction fetch(map, key) {\n let values = map.get(key);\n if (!values) {\n values = new Set();\n map.set(key, values);\n }\n return values;\n}\nfunction prune(map, key) {\n const values = map.get(key);\n if (values != null && values.size == 0) {\n map.delete(key);\n }\n}\n\nclass Multimap {\n constructor() {\n this.valuesByKey = new Map();\n }\n get keys() {\n return Array.from(this.valuesByKey.keys());\n }\n get values() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((values, set) => values.concat(Array.from(set)), []);\n }\n get size() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((size, set) => size + set.size, 0);\n }\n add(key, value) {\n add(this.valuesByKey, key, value);\n }\n delete(key, value) {\n del(this.valuesByKey, key, value);\n }\n has(key, value) {\n const values = this.valuesByKey.get(key);\n return values != null && values.has(value);\n }\n hasKey(key) {\n return this.valuesByKey.has(key);\n }\n hasValue(value) {\n const sets = Array.from(this.valuesByKey.values());\n return sets.some((set) => set.has(value));\n }\n getValuesForKey(key) {\n const values = this.valuesByKey.get(key);\n return values ? Array.from(values) : [];\n }\n getKeysForValue(value) {\n return Array.from(this.valuesByKey)\n .filter(([_key, values]) => values.has(value))\n .map(([key, _values]) => key);\n }\n}\n\nclass IndexedMultimap extends Multimap {\n constructor() {\n super();\n this.keysByValue = new Map();\n }\n get values() {\n return Array.from(this.keysByValue.keys());\n }\n add(key, value) {\n super.add(key, value);\n add(this.keysByValue, value, key);\n }\n delete(key, value) {\n super.delete(key, value);\n del(this.keysByValue, value, key);\n }\n hasValue(value) {\n return this.keysByValue.has(value);\n }\n getKeysForValue(value) {\n const set = this.keysByValue.get(value);\n return set ? Array.from(set) : [];\n }\n}\n\nclass SelectorObserver {\n constructor(element, selector, delegate, details) {\n this._selector = selector;\n this.details = details;\n this.elementObserver = new ElementObserver(element, this);\n this.delegate = delegate;\n this.matchesByElement = new Multimap();\n }\n get started() {\n return this.elementObserver.started;\n }\n get selector() {\n return this._selector;\n }\n set selector(selector) {\n this._selector = selector;\n this.refresh();\n }\n start() {\n this.elementObserver.start();\n }\n pause(callback) {\n this.elementObserver.pause(callback);\n }\n stop() {\n this.elementObserver.stop();\n }\n refresh() {\n this.elementObserver.refresh();\n }\n get element() {\n return this.elementObserver.element;\n }\n matchElement(element) {\n const { selector } = this;\n if (selector) {\n const matches = element.matches(selector);\n if (this.delegate.selectorMatchElement) {\n return matches && this.delegate.selectorMatchElement(element, this.details);\n }\n return matches;\n }\n else {\n return false;\n }\n }\n matchElementsInTree(tree) {\n const { selector } = this;\n if (selector) {\n const match = this.matchElement(tree) ? [tree] : [];\n const matches = Array.from(tree.querySelectorAll(selector)).filter((match) => this.matchElement(match));\n return match.concat(matches);\n }\n else {\n return [];\n }\n }\n elementMatched(element) {\n const { selector } = this;\n if (selector) {\n this.selectorMatched(element, selector);\n }\n }\n elementUnmatched(element) {\n const selectors = this.matchesByElement.getKeysForValue(element);\n for (const selector of selectors) {\n this.selectorUnmatched(element, selector);\n }\n }\n elementAttributeChanged(element, _attributeName) {\n const { selector } = this;\n if (selector) {\n const matches = this.matchElement(element);\n const matchedBefore = this.matchesByElement.has(selector, element);\n if (matches && !matchedBefore) {\n this.selectorMatched(element, selector);\n }\n else if (!matches && matchedBefore) {\n this.selectorUnmatched(element, selector);\n }\n }\n }\n selectorMatched(element, selector) {\n this.delegate.selectorMatched(element, selector, this.details);\n this.matchesByElement.add(selector, element);\n }\n selectorUnmatched(element, selector) {\n this.delegate.selectorUnmatched(element, selector, this.details);\n this.matchesByElement.delete(selector, element);\n }\n}\n\nclass StringMapObserver {\n constructor(element, delegate) {\n this.element = element;\n this.delegate = delegate;\n this.started = false;\n this.stringMap = new Map();\n this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, { attributes: true, attributeOldValue: true });\n this.refresh();\n }\n }\n stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n for (const attributeName of this.knownAttributeNames) {\n this.refreshAttribute(attributeName, null);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n const attributeName = mutation.attributeName;\n if (attributeName) {\n this.refreshAttribute(attributeName, mutation.oldValue);\n }\n }\n refreshAttribute(attributeName, oldValue) {\n const key = this.delegate.getStringMapKeyForAttribute(attributeName);\n if (key != null) {\n if (!this.stringMap.has(attributeName)) {\n this.stringMapKeyAdded(key, attributeName);\n }\n const value = this.element.getAttribute(attributeName);\n if (this.stringMap.get(attributeName) != value) {\n this.stringMapValueChanged(value, key, oldValue);\n }\n if (value == null) {\n const oldValue = this.stringMap.get(attributeName);\n this.stringMap.delete(attributeName);\n if (oldValue)\n this.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n else {\n this.stringMap.set(attributeName, value);\n }\n }\n }\n stringMapKeyAdded(key, attributeName) {\n if (this.delegate.stringMapKeyAdded) {\n this.delegate.stringMapKeyAdded(key, attributeName);\n }\n }\n stringMapValueChanged(value, key, oldValue) {\n if (this.delegate.stringMapValueChanged) {\n this.delegate.stringMapValueChanged(value, key, oldValue);\n }\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n if (this.delegate.stringMapKeyRemoved) {\n this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n }\n get knownAttributeNames() {\n return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n }\n get currentAttributeNames() {\n return Array.from(this.element.attributes).map((attribute) => attribute.name);\n }\n get recordedAttributeNames() {\n return Array.from(this.stringMap.keys());\n }\n}\n\nclass TokenListObserver {\n constructor(element, attributeName, delegate) {\n this.attributeObserver = new AttributeObserver(element, attributeName, this);\n this.delegate = delegate;\n this.tokensByElement = new Multimap();\n }\n get started() {\n return this.attributeObserver.started;\n }\n start() {\n this.attributeObserver.start();\n }\n pause(callback) {\n this.attributeObserver.pause(callback);\n }\n stop() {\n this.attributeObserver.stop();\n }\n refresh() {\n this.attributeObserver.refresh();\n }\n get element() {\n return this.attributeObserver.element;\n }\n get attributeName() {\n return this.attributeObserver.attributeName;\n }\n elementMatchedAttribute(element) {\n this.tokensMatched(this.readTokensForElement(element));\n }\n elementAttributeValueChanged(element) {\n const [unmatchedTokens, matchedTokens] = this.refreshTokensForElement(element);\n this.tokensUnmatched(unmatchedTokens);\n this.tokensMatched(matchedTokens);\n }\n elementUnmatchedAttribute(element) {\n this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n }\n tokensMatched(tokens) {\n tokens.forEach((token) => this.tokenMatched(token));\n }\n tokensUnmatched(tokens) {\n tokens.forEach((token) => this.tokenUnmatched(token));\n }\n tokenMatched(token) {\n this.delegate.tokenMatched(token);\n this.tokensByElement.add(token.element, token);\n }\n tokenUnmatched(token) {\n this.delegate.tokenUnmatched(token);\n this.tokensByElement.delete(token.element, token);\n }\n refreshTokensForElement(element) {\n const previousTokens = this.tokensByElement.getValuesForKey(element);\n const currentTokens = this.readTokensForElement(element);\n const firstDifferingIndex = zip(previousTokens, currentTokens).findIndex(([previousToken, currentToken]) => !tokensAreEqual(previousToken, currentToken));\n if (firstDifferingIndex == -1) {\n return [[], []];\n }\n else {\n return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n }\n }\n readTokensForElement(element) {\n const attributeName = this.attributeName;\n const tokenString = element.getAttribute(attributeName) || \"\";\n return parseTokenString(tokenString, element, attributeName);\n }\n}\nfunction parseTokenString(tokenString, element, attributeName) {\n return tokenString\n .trim()\n .split(/\\s+/)\n .filter((content) => content.length)\n .map((content, index) => ({ element, attributeName, content, index }));\n}\nfunction zip(left, right) {\n const length = Math.max(left.length, right.length);\n return Array.from({ length }, (_, index) => [left[index], right[index]]);\n}\nfunction tokensAreEqual(left, right) {\n return left && right && left.index == right.index && left.content == right.content;\n}\n\nclass ValueListObserver {\n constructor(element, attributeName, delegate) {\n this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n this.delegate = delegate;\n this.parseResultsByToken = new WeakMap();\n this.valuesByTokenByElement = new WeakMap();\n }\n get started() {\n return this.tokenListObserver.started;\n }\n start() {\n this.tokenListObserver.start();\n }\n stop() {\n this.tokenListObserver.stop();\n }\n refresh() {\n this.tokenListObserver.refresh();\n }\n get element() {\n return this.tokenListObserver.element;\n }\n get attributeName() {\n return this.tokenListObserver.attributeName;\n }\n tokenMatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).set(token, value);\n this.delegate.elementMatchedValue(element, value);\n }\n }\n tokenUnmatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).delete(token);\n this.delegate.elementUnmatchedValue(element, value);\n }\n }\n fetchParseResultForToken(token) {\n let parseResult = this.parseResultsByToken.get(token);\n if (!parseResult) {\n parseResult = this.parseToken(token);\n this.parseResultsByToken.set(token, parseResult);\n }\n return parseResult;\n }\n fetchValuesByTokenForElement(element) {\n let valuesByToken = this.valuesByTokenByElement.get(element);\n if (!valuesByToken) {\n valuesByToken = new Map();\n this.valuesByTokenByElement.set(element, valuesByToken);\n }\n return valuesByToken;\n }\n parseToken(token) {\n try {\n const value = this.delegate.parseValueForToken(token);\n return { value };\n }\n catch (error) {\n return { error };\n }\n }\n}\n\nclass BindingObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.bindingsByAction = new Map();\n }\n start() {\n if (!this.valueListObserver) {\n this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n this.valueListObserver.start();\n }\n }\n stop() {\n if (this.valueListObserver) {\n this.valueListObserver.stop();\n delete this.valueListObserver;\n this.disconnectAllActions();\n }\n }\n get element() {\n return this.context.element;\n }\n get identifier() {\n return this.context.identifier;\n }\n get actionAttribute() {\n return this.schema.actionAttribute;\n }\n get schema() {\n return this.context.schema;\n }\n get bindings() {\n return Array.from(this.bindingsByAction.values());\n }\n connectAction(action) {\n const binding = new Binding(this.context, action);\n this.bindingsByAction.set(action, binding);\n this.delegate.bindingConnected(binding);\n }\n disconnectAction(action) {\n const binding = this.bindingsByAction.get(action);\n if (binding) {\n this.bindingsByAction.delete(action);\n this.delegate.bindingDisconnected(binding);\n }\n }\n disconnectAllActions() {\n this.bindings.forEach((binding) => this.delegate.bindingDisconnected(binding, true));\n this.bindingsByAction.clear();\n }\n parseValueForToken(token) {\n const action = Action.forToken(token, this.schema);\n if (action.identifier == this.identifier) {\n return action;\n }\n }\n elementMatchedValue(element, action) {\n this.connectAction(action);\n }\n elementUnmatchedValue(element, action) {\n this.disconnectAction(action);\n }\n}\n\nclass ValueObserver {\n constructor(context, receiver) {\n this.context = context;\n this.receiver = receiver;\n this.stringMapObserver = new StringMapObserver(this.element, this);\n this.valueDescriptorMap = this.controller.valueDescriptorMap;\n }\n start() {\n this.stringMapObserver.start();\n this.invokeChangedCallbacksForDefaultValues();\n }\n stop() {\n this.stringMapObserver.stop();\n }\n get element() {\n return this.context.element;\n }\n get controller() {\n return this.context.controller;\n }\n getStringMapKeyForAttribute(attributeName) {\n if (attributeName in this.valueDescriptorMap) {\n return this.valueDescriptorMap[attributeName].name;\n }\n }\n stringMapKeyAdded(key, attributeName) {\n const descriptor = this.valueDescriptorMap[attributeName];\n if (!this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n }\n }\n stringMapValueChanged(value, name, oldValue) {\n const descriptor = this.valueDescriptorNameMap[name];\n if (value === null)\n return;\n if (oldValue === null) {\n oldValue = descriptor.writer(descriptor.defaultValue);\n }\n this.invokeChangedCallback(name, value, oldValue);\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n const descriptor = this.valueDescriptorNameMap[key];\n if (this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n }\n else {\n this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n }\n }\n invokeChangedCallbacksForDefaultValues() {\n for (const { key, name, defaultValue, writer } of this.valueDescriptors) {\n if (defaultValue != undefined && !this.controller.data.has(key)) {\n this.invokeChangedCallback(name, writer(defaultValue), undefined);\n }\n }\n }\n invokeChangedCallback(name, rawValue, rawOldValue) {\n const changedMethodName = `${name}Changed`;\n const changedMethod = this.receiver[changedMethodName];\n if (typeof changedMethod == \"function\") {\n const descriptor = this.valueDescriptorNameMap[name];\n try {\n const value = descriptor.reader(rawValue);\n let oldValue = rawOldValue;\n if (rawOldValue) {\n oldValue = descriptor.reader(rawOldValue);\n }\n changedMethod.call(this.receiver, value, oldValue);\n }\n catch (error) {\n if (error instanceof TypeError) {\n error.message = `Stimulus Value \"${this.context.identifier}.${descriptor.name}\" - ${error.message}`;\n }\n throw error;\n }\n }\n }\n get valueDescriptors() {\n const { valueDescriptorMap } = this;\n return Object.keys(valueDescriptorMap).map((key) => valueDescriptorMap[key]);\n }\n get valueDescriptorNameMap() {\n const descriptors = {};\n Object.keys(this.valueDescriptorMap).forEach((key) => {\n const descriptor = this.valueDescriptorMap[key];\n descriptors[descriptor.name] = descriptor;\n });\n return descriptors;\n }\n hasValue(attributeName) {\n const descriptor = this.valueDescriptorNameMap[attributeName];\n const hasMethodName = `has${capitalize(descriptor.name)}`;\n return this.receiver[hasMethodName];\n }\n}\n\nclass TargetObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.targetsByName = new Multimap();\n }\n start() {\n if (!this.tokenListObserver) {\n this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n this.tokenListObserver.start();\n }\n }\n stop() {\n if (this.tokenListObserver) {\n this.disconnectAllTargets();\n this.tokenListObserver.stop();\n delete this.tokenListObserver;\n }\n }\n tokenMatched({ element, content: name }) {\n if (this.scope.containsElement(element)) {\n this.connectTarget(element, name);\n }\n }\n tokenUnmatched({ element, content: name }) {\n this.disconnectTarget(element, name);\n }\n connectTarget(element, name) {\n var _a;\n if (!this.targetsByName.has(name, element)) {\n this.targetsByName.add(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetConnected(element, name));\n }\n }\n disconnectTarget(element, name) {\n var _a;\n if (this.targetsByName.has(name, element)) {\n this.targetsByName.delete(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetDisconnected(element, name));\n }\n }\n disconnectAllTargets() {\n for (const name of this.targetsByName.keys) {\n for (const element of this.targetsByName.getValuesForKey(name)) {\n this.disconnectTarget(element, name);\n }\n }\n }\n get attributeName() {\n return `data-${this.context.identifier}-target`;\n }\n get element() {\n return this.context.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return Array.from(ancestors.reduce((values, constructor) => {\n getOwnStaticArrayValues(constructor, propertyName).forEach((name) => values.add(name));\n return values;\n }, new Set()));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return ancestors.reduce((pairs, constructor) => {\n pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n return pairs;\n }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n const ancestors = [];\n while (constructor) {\n ancestors.push(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n const definition = constructor[propertyName];\n return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n const definition = constructor[propertyName];\n return definition ? Object.keys(definition).map((key) => [key, definition[key]]) : [];\n}\n\nclass OutletObserver {\n constructor(context, delegate) {\n this.started = false;\n this.context = context;\n this.delegate = delegate;\n this.outletsByName = new Multimap();\n this.outletElementsByName = new Multimap();\n this.selectorObserverMap = new Map();\n this.attributeObserverMap = new Map();\n }\n start() {\n if (!this.started) {\n this.outletDefinitions.forEach((outletName) => {\n this.setupSelectorObserverForOutlet(outletName);\n this.setupAttributeObserverForOutlet(outletName);\n });\n this.started = true;\n this.dependentContexts.forEach((context) => context.refresh());\n }\n }\n refresh() {\n this.selectorObserverMap.forEach((observer) => observer.refresh());\n this.attributeObserverMap.forEach((observer) => observer.refresh());\n }\n stop() {\n if (this.started) {\n this.started = false;\n this.disconnectAllOutlets();\n this.stopSelectorObservers();\n this.stopAttributeObservers();\n }\n }\n stopSelectorObservers() {\n if (this.selectorObserverMap.size > 0) {\n this.selectorObserverMap.forEach((observer) => observer.stop());\n this.selectorObserverMap.clear();\n }\n }\n stopAttributeObservers() {\n if (this.attributeObserverMap.size > 0) {\n this.attributeObserverMap.forEach((observer) => observer.stop());\n this.attributeObserverMap.clear();\n }\n }\n selectorMatched(element, _selector, { outletName }) {\n const outlet = this.getOutlet(element, outletName);\n if (outlet) {\n this.connectOutlet(outlet, element, outletName);\n }\n }\n selectorUnmatched(element, _selector, { outletName }) {\n const outlet = this.getOutletFromMap(element, outletName);\n if (outlet) {\n this.disconnectOutlet(outlet, element, outletName);\n }\n }\n selectorMatchElement(element, { outletName }) {\n const selector = this.selector(outletName);\n const hasOutlet = this.hasOutlet(element, outletName);\n const hasOutletController = element.matches(`[${this.schema.controllerAttribute}~=${outletName}]`);\n if (selector) {\n return hasOutlet && hasOutletController && element.matches(selector);\n }\n else {\n return false;\n }\n }\n elementMatchedAttribute(_element, attributeName) {\n const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n if (outletName) {\n this.updateSelectorObserverForOutlet(outletName);\n }\n }\n elementAttributeValueChanged(_element, attributeName) {\n const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n if (outletName) {\n this.updateSelectorObserverForOutlet(outletName);\n }\n }\n elementUnmatchedAttribute(_element, attributeName) {\n const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n if (outletName) {\n this.updateSelectorObserverForOutlet(outletName);\n }\n }\n connectOutlet(outlet, element, outletName) {\n var _a;\n if (!this.outletElementsByName.has(outletName, element)) {\n this.outletsByName.add(outletName, outlet);\n this.outletElementsByName.add(outletName, element);\n (_a = this.selectorObserverMap.get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletConnected(outlet, element, outletName));\n }\n }\n disconnectOutlet(outlet, element, outletName) {\n var _a;\n if (this.outletElementsByName.has(outletName, element)) {\n this.outletsByName.delete(outletName, outlet);\n this.outletElementsByName.delete(outletName, element);\n (_a = this.selectorObserverMap\n .get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletDisconnected(outlet, element, outletName));\n }\n }\n disconnectAllOutlets() {\n for (const outletName of this.outletElementsByName.keys) {\n for (const element of this.outletElementsByName.getValuesForKey(outletName)) {\n for (const outlet of this.outletsByName.getValuesForKey(outletName)) {\n this.disconnectOutlet(outlet, element, outletName);\n }\n }\n }\n }\n updateSelectorObserverForOutlet(outletName) {\n const observer = this.selectorObserverMap.get(outletName);\n if (observer) {\n observer.selector = this.selector(outletName);\n }\n }\n setupSelectorObserverForOutlet(outletName) {\n const selector = this.selector(outletName);\n const selectorObserver = new SelectorObserver(document.body, selector, this, { outletName });\n this.selectorObserverMap.set(outletName, selectorObserver);\n selectorObserver.start();\n }\n setupAttributeObserverForOutlet(outletName) {\n const attributeName = this.attributeNameForOutletName(outletName);\n const attributeObserver = new AttributeObserver(this.scope.element, attributeName, this);\n this.attributeObserverMap.set(outletName, attributeObserver);\n attributeObserver.start();\n }\n selector(outletName) {\n return this.scope.outlets.getSelectorForOutletName(outletName);\n }\n attributeNameForOutletName(outletName) {\n return this.scope.schema.outletAttributeForScope(this.identifier, outletName);\n }\n getOutletNameFromOutletAttributeName(attributeName) {\n return this.outletDefinitions.find((outletName) => this.attributeNameForOutletName(outletName) === attributeName);\n }\n get outletDependencies() {\n const dependencies = new Multimap();\n this.router.modules.forEach((module) => {\n const constructor = module.definition.controllerConstructor;\n const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n outlets.forEach((outlet) => dependencies.add(outlet, module.identifier));\n });\n return dependencies;\n }\n get outletDefinitions() {\n return this.outletDependencies.getKeysForValue(this.identifier);\n }\n get dependentControllerIdentifiers() {\n return this.outletDependencies.getValuesForKey(this.identifier);\n }\n get dependentContexts() {\n const identifiers = this.dependentControllerIdentifiers;\n return this.router.contexts.filter((context) => identifiers.includes(context.identifier));\n }\n hasOutlet(element, outletName) {\n return !!this.getOutlet(element, outletName) || !!this.getOutletFromMap(element, outletName);\n }\n getOutlet(element, outletName) {\n return this.application.getControllerForElementAndIdentifier(element, outletName);\n }\n getOutletFromMap(element, outletName) {\n return this.outletsByName.getValuesForKey(outletName).find((outlet) => outlet.element === element);\n }\n get scope() {\n return this.context.scope;\n }\n get schema() {\n return this.context.schema;\n }\n get identifier() {\n return this.context.identifier;\n }\n get application() {\n return this.context.application;\n }\n get router() {\n return this.application.router;\n }\n}\n\nclass Context {\n constructor(module, scope) {\n this.logDebugActivity = (functionName, detail = {}) => {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.logDebugActivity(this.identifier, functionName, detail);\n };\n this.module = module;\n this.scope = scope;\n this.controller = new module.controllerConstructor(this);\n this.bindingObserver = new BindingObserver(this, this.dispatcher);\n this.valueObserver = new ValueObserver(this, this.controller);\n this.targetObserver = new TargetObserver(this, this);\n this.outletObserver = new OutletObserver(this, this);\n try {\n this.controller.initialize();\n this.logDebugActivity(\"initialize\");\n }\n catch (error) {\n this.handleError(error, \"initializing controller\");\n }\n }\n connect() {\n this.bindingObserver.start();\n this.valueObserver.start();\n this.targetObserver.start();\n this.outletObserver.start();\n try {\n this.controller.connect();\n this.logDebugActivity(\"connect\");\n }\n catch (error) {\n this.handleError(error, \"connecting controller\");\n }\n }\n refresh() {\n this.outletObserver.refresh();\n }\n disconnect() {\n try {\n this.controller.disconnect();\n this.logDebugActivity(\"disconnect\");\n }\n catch (error) {\n this.handleError(error, \"disconnecting controller\");\n }\n this.outletObserver.stop();\n this.targetObserver.stop();\n this.valueObserver.stop();\n this.bindingObserver.stop();\n }\n get application() {\n return this.module.application;\n }\n get identifier() {\n return this.module.identifier;\n }\n get schema() {\n return this.application.schema;\n }\n get dispatcher() {\n return this.application.dispatcher;\n }\n get element() {\n return this.scope.element;\n }\n get parentElement() {\n return this.element.parentElement;\n }\n handleError(error, message, detail = {}) {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.handleError(error, `Error ${message}`, detail);\n }\n targetConnected(element, name) {\n this.invokeControllerMethod(`${name}TargetConnected`, element);\n }\n targetDisconnected(element, name) {\n this.invokeControllerMethod(`${name}TargetDisconnected`, element);\n }\n outletConnected(outlet, element, name) {\n this.invokeControllerMethod(`${namespaceCamelize(name)}OutletConnected`, outlet, element);\n }\n outletDisconnected(outlet, element, name) {\n this.invokeControllerMethod(`${namespaceCamelize(name)}OutletDisconnected`, outlet, element);\n }\n invokeControllerMethod(methodName, ...args) {\n const controller = this.controller;\n if (typeof controller[methodName] == \"function\") {\n controller[methodName](...args);\n }\n }\n}\n\nfunction bless(constructor) {\n return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n const shadowConstructor = extend(constructor);\n const shadowProperties = getShadowProperties(constructor.prototype, properties);\n Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n const blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n return blessings.reduce((blessedProperties, blessing) => {\n const properties = blessing(constructor);\n for (const key in properties) {\n const descriptor = blessedProperties[key] || {};\n blessedProperties[key] = Object.assign(descriptor, properties[key]);\n }\n return blessedProperties;\n }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n return getOwnKeys(properties).reduce((shadowProperties, key) => {\n const descriptor = getShadowedDescriptor(prototype, properties, key);\n if (descriptor) {\n Object.assign(shadowProperties, { [key]: descriptor });\n }\n return shadowProperties;\n }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n const shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n const shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n if (!shadowedByValue) {\n const descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n if (shadowingDescriptor) {\n descriptor.get = shadowingDescriptor.get || descriptor.get;\n descriptor.set = shadowingDescriptor.set || descriptor.set;\n }\n return descriptor;\n }\n}\nconst getOwnKeys = (() => {\n if (typeof Object.getOwnPropertySymbols == \"function\") {\n return (object) => [...Object.getOwnPropertyNames(object), ...Object.getOwnPropertySymbols(object)];\n }\n else {\n return Object.getOwnPropertyNames;\n }\n})();\nconst extend = (() => {\n function extendWithReflect(constructor) {\n function extended() {\n return Reflect.construct(constructor, arguments, new.target);\n }\n extended.prototype = Object.create(constructor.prototype, {\n constructor: { value: extended },\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n function testReflectExtension() {\n const a = function () {\n this.a.call(this);\n };\n const b = extendWithReflect(a);\n b.prototype.a = function () { };\n return new b();\n }\n try {\n testReflectExtension();\n return extendWithReflect;\n }\n catch (error) {\n return (constructor) => class extended extends constructor {\n };\n }\n})();\n\nfunction blessDefinition(definition) {\n return {\n identifier: definition.identifier,\n controllerConstructor: bless(definition.controllerConstructor),\n };\n}\n\nclass Module {\n constructor(application, definition) {\n this.application = application;\n this.definition = blessDefinition(definition);\n this.contextsByScope = new WeakMap();\n this.connectedContexts = new Set();\n }\n get identifier() {\n return this.definition.identifier;\n }\n get controllerConstructor() {\n return this.definition.controllerConstructor;\n }\n get contexts() {\n return Array.from(this.connectedContexts);\n }\n connectContextForScope(scope) {\n const context = this.fetchContextForScope(scope);\n this.connectedContexts.add(context);\n context.connect();\n }\n disconnectContextForScope(scope) {\n const context = this.contextsByScope.get(scope);\n if (context) {\n this.connectedContexts.delete(context);\n context.disconnect();\n }\n }\n fetchContextForScope(scope) {\n let context = this.contextsByScope.get(scope);\n if (!context) {\n context = new Context(this, scope);\n this.contextsByScope.set(scope, context);\n }\n return context;\n }\n}\n\nclass ClassMap {\n constructor(scope) {\n this.scope = scope;\n }\n has(name) {\n return this.data.has(this.getDataKey(name));\n }\n get(name) {\n return this.getAll(name)[0];\n }\n getAll(name) {\n const tokenString = this.data.get(this.getDataKey(name)) || \"\";\n return tokenize(tokenString);\n }\n getAttributeName(name) {\n return this.data.getAttributeNameForKey(this.getDataKey(name));\n }\n getDataKey(name) {\n return `${name}-class`;\n }\n get data() {\n return this.scope.data;\n }\n}\n\nclass DataMap {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.getAttribute(name);\n }\n set(key, value) {\n const name = this.getAttributeNameForKey(key);\n this.element.setAttribute(name, value);\n return this.get(key);\n }\n has(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.hasAttribute(name);\n }\n delete(key) {\n if (this.has(key)) {\n const name = this.getAttributeNameForKey(key);\n this.element.removeAttribute(name);\n return true;\n }\n else {\n return false;\n }\n }\n getAttributeNameForKey(key) {\n return `data-${this.identifier}-${dasherize(key)}`;\n }\n}\n\nclass Guide {\n constructor(logger) {\n this.warnedKeysByObject = new WeakMap();\n this.logger = logger;\n }\n warn(object, key, message) {\n let warnedKeys = this.warnedKeysByObject.get(object);\n if (!warnedKeys) {\n warnedKeys = new Set();\n this.warnedKeysByObject.set(object, warnedKeys);\n }\n if (!warnedKeys.has(key)) {\n warnedKeys.add(key);\n this.logger.warn(message, object);\n }\n }\n}\n\nfunction attributeValueContainsToken(attributeName, token) {\n return `[${attributeName}~=\"${token}\"]`;\n}\n\nclass TargetSet {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get schema() {\n return this.scope.schema;\n }\n has(targetName) {\n return this.find(targetName) != null;\n }\n find(...targetNames) {\n return targetNames.reduce((target, targetName) => target || this.findTarget(targetName) || this.findLegacyTarget(targetName), undefined);\n }\n findAll(...targetNames) {\n return targetNames.reduce((targets, targetName) => [\n ...targets,\n ...this.findAllTargets(targetName),\n ...this.findAllLegacyTargets(targetName),\n ], []);\n }\n findTarget(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findElement(selector);\n }\n findAllTargets(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findAllElements(selector);\n }\n getSelectorForTargetName(targetName) {\n const attributeName = this.schema.targetAttributeForScope(this.identifier);\n return attributeValueContainsToken(attributeName, targetName);\n }\n findLegacyTarget(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.deprecate(this.scope.findElement(selector), targetName);\n }\n findAllLegacyTargets(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.scope.findAllElements(selector).map((element) => this.deprecate(element, targetName));\n }\n getLegacySelectorForTargetName(targetName) {\n const targetDescriptor = `${this.identifier}.${targetName}`;\n return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n }\n deprecate(element, targetName) {\n if (element) {\n const { identifier } = this;\n const attributeName = this.schema.targetAttribute;\n const revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n this.guide.warn(element, `target:${targetName}`, `Please replace ${attributeName}=\"${identifier}.${targetName}\" with ${revisedAttributeName}=\"${targetName}\". ` +\n `The ${attributeName} attribute is deprecated and will be removed in a future version of Stimulus.`);\n }\n return element;\n }\n get guide() {\n return this.scope.guide;\n }\n}\n\nclass OutletSet {\n constructor(scope, controllerElement) {\n this.scope = scope;\n this.controllerElement = controllerElement;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get schema() {\n return this.scope.schema;\n }\n has(outletName) {\n return this.find(outletName) != null;\n }\n find(...outletNames) {\n return outletNames.reduce((outlet, outletName) => outlet || this.findOutlet(outletName), undefined);\n }\n findAll(...outletNames) {\n return outletNames.reduce((outlets, outletName) => [...outlets, ...this.findAllOutlets(outletName)], []);\n }\n getSelectorForOutletName(outletName) {\n const attributeName = this.schema.outletAttributeForScope(this.identifier, outletName);\n return this.controllerElement.getAttribute(attributeName);\n }\n findOutlet(outletName) {\n const selector = this.getSelectorForOutletName(outletName);\n if (selector)\n return this.findElement(selector, outletName);\n }\n findAllOutlets(outletName) {\n const selector = this.getSelectorForOutletName(outletName);\n return selector ? this.findAllElements(selector, outletName) : [];\n }\n findElement(selector, outletName) {\n const elements = this.scope.queryElements(selector);\n return elements.filter((element) => this.matchesElement(element, selector, outletName))[0];\n }\n findAllElements(selector, outletName) {\n const elements = this.scope.queryElements(selector);\n return elements.filter((element) => this.matchesElement(element, selector, outletName));\n }\n matchesElement(element, selector, outletName) {\n const controllerAttribute = element.getAttribute(this.scope.schema.controllerAttribute) || \"\";\n return element.matches(selector) && controllerAttribute.split(\" \").includes(outletName);\n }\n}\n\nclass Scope {\n constructor(schema, element, identifier, logger) {\n this.targets = new TargetSet(this);\n this.classes = new ClassMap(this);\n this.data = new DataMap(this);\n this.containsElement = (element) => {\n return element.closest(this.controllerSelector) === this.element;\n };\n this.schema = schema;\n this.element = element;\n this.identifier = identifier;\n this.guide = new Guide(logger);\n this.outlets = new OutletSet(this.documentScope, element);\n }\n findElement(selector) {\n return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);\n }\n findAllElements(selector) {\n return [\n ...(this.element.matches(selector) ? [this.element] : []),\n ...this.queryElements(selector).filter(this.containsElement),\n ];\n }\n queryElements(selector) {\n return Array.from(this.element.querySelectorAll(selector));\n }\n get controllerSelector() {\n return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n }\n get isDocumentScope() {\n return this.element === document.documentElement;\n }\n get documentScope() {\n return this.isDocumentScope\n ? this\n : new Scope(this.schema, document.documentElement, this.identifier, this.guide.logger);\n }\n}\n\nclass ScopeObserver {\n constructor(element, schema, delegate) {\n this.element = element;\n this.schema = schema;\n this.delegate = delegate;\n this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n this.scopesByIdentifierByElement = new WeakMap();\n this.scopeReferenceCounts = new WeakMap();\n }\n start() {\n this.valueListObserver.start();\n }\n stop() {\n this.valueListObserver.stop();\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n parseValueForToken(token) {\n const { element, content: identifier } = token;\n return this.parseValueForElementAndIdentifier(element, identifier);\n }\n parseValueForElementAndIdentifier(element, identifier) {\n const scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n let scope = scopesByIdentifier.get(identifier);\n if (!scope) {\n scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n scopesByIdentifier.set(identifier, scope);\n }\n return scope;\n }\n elementMatchedValue(element, value) {\n const referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n this.scopeReferenceCounts.set(value, referenceCount);\n if (referenceCount == 1) {\n this.delegate.scopeConnected(value);\n }\n }\n elementUnmatchedValue(element, value) {\n const referenceCount = this.scopeReferenceCounts.get(value);\n if (referenceCount) {\n this.scopeReferenceCounts.set(value, referenceCount - 1);\n if (referenceCount == 1) {\n this.delegate.scopeDisconnected(value);\n }\n }\n }\n fetchScopesByIdentifierForElement(element) {\n let scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n if (!scopesByIdentifier) {\n scopesByIdentifier = new Map();\n this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n }\n return scopesByIdentifier;\n }\n}\n\nclass Router {\n constructor(application) {\n this.application = application;\n this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n this.scopesByIdentifier = new Multimap();\n this.modulesByIdentifier = new Map();\n }\n get element() {\n return this.application.element;\n }\n get schema() {\n return this.application.schema;\n }\n get logger() {\n return this.application.logger;\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n get modules() {\n return Array.from(this.modulesByIdentifier.values());\n }\n get contexts() {\n return this.modules.reduce((contexts, module) => contexts.concat(module.contexts), []);\n }\n start() {\n this.scopeObserver.start();\n }\n stop() {\n this.scopeObserver.stop();\n }\n loadDefinition(definition) {\n this.unloadIdentifier(definition.identifier);\n const module = new Module(this.application, definition);\n this.connectModule(module);\n const afterLoad = definition.controllerConstructor.afterLoad;\n if (afterLoad) {\n afterLoad.call(definition.controllerConstructor, definition.identifier, this.application);\n }\n }\n unloadIdentifier(identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n this.disconnectModule(module);\n }\n }\n getContextForElementAndIdentifier(element, identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n return module.contexts.find((context) => context.element == element);\n }\n }\n proposeToConnectScopeForElementAndIdentifier(element, identifier) {\n const scope = this.scopeObserver.parseValueForElementAndIdentifier(element, identifier);\n if (scope) {\n this.scopeObserver.elementMatchedValue(scope.element, scope);\n }\n else {\n console.error(`Couldn't find or create scope for identifier: \"${identifier}\" and element:`, element);\n }\n }\n handleError(error, message, detail) {\n this.application.handleError(error, message, detail);\n }\n createScopeForElementAndIdentifier(element, identifier) {\n return new Scope(this.schema, element, identifier, this.logger);\n }\n scopeConnected(scope) {\n this.scopesByIdentifier.add(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.connectContextForScope(scope);\n }\n }\n scopeDisconnected(scope) {\n this.scopesByIdentifier.delete(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.disconnectContextForScope(scope);\n }\n }\n connectModule(module) {\n this.modulesByIdentifier.set(module.identifier, module);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach((scope) => module.connectContextForScope(scope));\n }\n disconnectModule(module) {\n this.modulesByIdentifier.delete(module.identifier);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach((scope) => module.disconnectContextForScope(scope));\n }\n}\n\nconst defaultSchema = {\n controllerAttribute: \"data-controller\",\n actionAttribute: \"data-action\",\n targetAttribute: \"data-target\",\n targetAttributeForScope: (identifier) => `data-${identifier}-target`,\n outletAttributeForScope: (identifier, outlet) => `data-${identifier}-${outlet}-outlet`,\n keyMappings: Object.assign(Object.assign({ enter: \"Enter\", tab: \"Tab\", esc: \"Escape\", space: \" \", up: \"ArrowUp\", down: \"ArrowDown\", left: \"ArrowLeft\", right: \"ArrowRight\", home: \"Home\", end: \"End\", page_up: \"PageUp\", page_down: \"PageDown\" }, objectFromEntries(\"abcdefghijklmnopqrstuvwxyz\".split(\"\").map((c) => [c, c]))), objectFromEntries(\"0123456789\".split(\"\").map((n) => [n, n]))),\n};\nfunction objectFromEntries(array) {\n return array.reduce((memo, [k, v]) => (Object.assign(Object.assign({}, memo), { [k]: v })), {});\n}\n\nclass Application {\n constructor(element = document.documentElement, schema = defaultSchema) {\n this.logger = console;\n this.debug = false;\n this.logDebugActivity = (identifier, functionName, detail = {}) => {\n if (this.debug) {\n this.logFormattedMessage(identifier, functionName, detail);\n }\n };\n this.element = element;\n this.schema = schema;\n this.dispatcher = new Dispatcher(this);\n this.router = new Router(this);\n this.actionDescriptorFilters = Object.assign({}, defaultActionDescriptorFilters);\n }\n static start(element, schema) {\n const application = new this(element, schema);\n application.start();\n return application;\n }\n async start() {\n await domReady();\n this.logDebugActivity(\"application\", \"starting\");\n this.dispatcher.start();\n this.router.start();\n this.logDebugActivity(\"application\", \"start\");\n }\n stop() {\n this.logDebugActivity(\"application\", \"stopping\");\n this.dispatcher.stop();\n this.router.stop();\n this.logDebugActivity(\"application\", \"stop\");\n }\n register(identifier, controllerConstructor) {\n this.load({ identifier, controllerConstructor });\n }\n registerActionOption(name, filter) {\n this.actionDescriptorFilters[name] = filter;\n }\n load(head, ...rest) {\n const definitions = Array.isArray(head) ? head : [head, ...rest];\n definitions.forEach((definition) => {\n if (definition.controllerConstructor.shouldLoad) {\n this.router.loadDefinition(definition);\n }\n });\n }\n unload(head, ...rest) {\n const identifiers = Array.isArray(head) ? head : [head, ...rest];\n identifiers.forEach((identifier) => this.router.unloadIdentifier(identifier));\n }\n get controllers() {\n return this.router.contexts.map((context) => context.controller);\n }\n getControllerForElementAndIdentifier(element, identifier) {\n const context = this.router.getContextForElementAndIdentifier(element, identifier);\n return context ? context.controller : null;\n }\n handleError(error, message, detail) {\n var _a;\n this.logger.error(`%s\\n\\n%o\\n\\n%o`, message, error, detail);\n (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n }\n logFormattedMessage(identifier, functionName, detail = {}) {\n detail = Object.assign({ application: this }, detail);\n this.logger.groupCollapsed(`${identifier} #${functionName}`);\n this.logger.log(\"details:\", Object.assign({}, detail));\n this.logger.groupEnd();\n }\n}\nfunction domReady() {\n return new Promise((resolve) => {\n if (document.readyState == \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", () => resolve());\n }\n else {\n resolve();\n }\n });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n return classes.reduce((properties, classDefinition) => {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\nfunction propertiesForClassDefinition(key) {\n return {\n [`${key}Class`]: {\n get() {\n const { classes } = this;\n if (classes.has(key)) {\n return classes.get(key);\n }\n else {\n const attribute = classes.getAttributeName(key);\n throw new Error(`Missing attribute \"${attribute}\"`);\n }\n },\n },\n [`${key}Classes`]: {\n get() {\n return this.classes.getAll(key);\n },\n },\n [`has${capitalize(key)}Class`]: {\n get() {\n return this.classes.has(key);\n },\n },\n };\n}\n\nfunction OutletPropertiesBlessing(constructor) {\n const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n return outlets.reduce((properties, outletDefinition) => {\n return Object.assign(properties, propertiesForOutletDefinition(outletDefinition));\n }, {});\n}\nfunction getOutletController(controller, element, identifier) {\n return controller.application.getControllerForElementAndIdentifier(element, identifier);\n}\nfunction getControllerAndEnsureConnectedScope(controller, element, outletName) {\n let outletController = getOutletController(controller, element, outletName);\n if (outletController)\n return outletController;\n controller.application.router.proposeToConnectScopeForElementAndIdentifier(element, outletName);\n outletController = getOutletController(controller, element, outletName);\n if (outletController)\n return outletController;\n}\nfunction propertiesForOutletDefinition(name) {\n const camelizedName = namespaceCamelize(name);\n return {\n [`${camelizedName}Outlet`]: {\n get() {\n const outletElement = this.outlets.find(name);\n const selector = this.outlets.getSelectorForOutletName(name);\n if (outletElement) {\n const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n if (outletController)\n return outletController;\n throw new Error(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`);\n }\n throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n },\n },\n [`${camelizedName}Outlets`]: {\n get() {\n const outlets = this.outlets.findAll(name);\n if (outlets.length > 0) {\n return outlets\n .map((outletElement) => {\n const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n if (outletController)\n return outletController;\n console.warn(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`, outletElement);\n })\n .filter((controller) => controller);\n }\n return [];\n },\n },\n [`${camelizedName}OutletElement`]: {\n get() {\n const outletElement = this.outlets.find(name);\n const selector = this.outlets.getSelectorForOutletName(name);\n if (outletElement) {\n return outletElement;\n }\n else {\n throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n }\n },\n },\n [`${camelizedName}OutletElements`]: {\n get() {\n return this.outlets.findAll(name);\n },\n },\n [`has${capitalize(camelizedName)}Outlet`]: {\n get() {\n return this.outlets.has(name);\n },\n },\n };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n return targets.reduce((properties, targetDefinition) => {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n return {\n [`${name}Target`]: {\n get() {\n const target = this.targets.find(name);\n if (target) {\n return target;\n }\n else {\n throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n }\n },\n },\n [`${name}Targets`]: {\n get() {\n return this.targets.findAll(name);\n },\n },\n [`has${capitalize(name)}Target`]: {\n get() {\n return this.targets.has(name);\n },\n },\n };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n const propertyDescriptorMap = {\n valueDescriptorMap: {\n get() {\n return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair, this.identifier);\n const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n return Object.assign(result, { [attributeName]: valueDescriptor });\n }, {});\n },\n },\n };\n return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair, controller) {\n const definition = parseValueDefinitionPair(valueDefinitionPair, controller);\n const { key, name, reader: read, writer: write } = definition;\n return {\n [name]: {\n get() {\n const value = this.data.get(key);\n if (value !== null) {\n return read(value);\n }\n else {\n return definition.defaultValue;\n }\n },\n set(value) {\n if (value === undefined) {\n this.data.delete(key);\n }\n else {\n this.data.set(key, write(value));\n }\n },\n },\n [`has${capitalize(name)}`]: {\n get() {\n return this.data.has(key) || definition.hasCustomDefaultValue;\n },\n },\n };\n}\nfunction parseValueDefinitionPair([token, typeDefinition], controller) {\n return valueDescriptorForTokenAndTypeDefinition({\n controller,\n token,\n typeDefinition,\n });\n}\nfunction parseValueTypeConstant(constant) {\n switch (constant) {\n case Array:\n return \"array\";\n case Boolean:\n return \"boolean\";\n case Number:\n return \"number\";\n case Object:\n return \"object\";\n case String:\n return \"string\";\n }\n}\nfunction parseValueTypeDefault(defaultValue) {\n switch (typeof defaultValue) {\n case \"boolean\":\n return \"boolean\";\n case \"number\":\n return \"number\";\n case \"string\":\n return \"string\";\n }\n if (Array.isArray(defaultValue))\n return \"array\";\n if (Object.prototype.toString.call(defaultValue) === \"[object Object]\")\n return \"object\";\n}\nfunction parseValueTypeObject(payload) {\n const { controller, token, typeObject } = payload;\n const hasType = isSomething(typeObject.type);\n const hasDefault = isSomething(typeObject.default);\n const fullObject = hasType && hasDefault;\n const onlyType = hasType && !hasDefault;\n const onlyDefault = !hasType && hasDefault;\n const typeFromObject = parseValueTypeConstant(typeObject.type);\n const typeFromDefaultValue = parseValueTypeDefault(payload.typeObject.default);\n if (onlyType)\n return typeFromObject;\n if (onlyDefault)\n return typeFromDefaultValue;\n if (typeFromObject !== typeFromDefaultValue) {\n const propertyPath = controller ? `${controller}.${token}` : token;\n throw new Error(`The specified default value for the Stimulus Value \"${propertyPath}\" must match the defined type \"${typeFromObject}\". The provided default value of \"${typeObject.default}\" is of type \"${typeFromDefaultValue}\".`);\n }\n if (fullObject)\n return typeFromObject;\n}\nfunction parseValueTypeDefinition(payload) {\n const { controller, token, typeDefinition } = payload;\n const typeObject = { controller, token, typeObject: typeDefinition };\n const typeFromObject = parseValueTypeObject(typeObject);\n const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n const typeFromConstant = parseValueTypeConstant(typeDefinition);\n const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n if (type)\n return type;\n const propertyPath = controller ? `${controller}.${typeDefinition}` : token;\n throw new Error(`Unknown value type \"${propertyPath}\" for \"${token}\" value`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n const constant = parseValueTypeConstant(typeDefinition);\n if (constant)\n return defaultValuesByType[constant];\n const hasDefault = hasProperty(typeDefinition, \"default\");\n const hasType = hasProperty(typeDefinition, \"type\");\n const typeObject = typeDefinition;\n if (hasDefault)\n return typeObject.default;\n if (hasType) {\n const { type } = typeObject;\n const constantFromType = parseValueTypeConstant(type);\n if (constantFromType)\n return defaultValuesByType[constantFromType];\n }\n return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(payload) {\n const { token, typeDefinition } = payload;\n const key = `${dasherize(token)}-value`;\n const type = parseValueTypeDefinition(payload);\n return {\n type,\n key,\n name: camelize(key),\n get defaultValue() {\n return defaultValueForDefinition(typeDefinition);\n },\n get hasCustomDefaultValue() {\n return parseValueTypeDefault(typeDefinition) !== undefined;\n },\n reader: readers[type],\n writer: writers[type] || writers.default,\n };\n}\nconst defaultValuesByType = {\n get array() {\n return [];\n },\n boolean: false,\n number: 0,\n get object() {\n return {};\n },\n string: \"\",\n};\nconst readers = {\n array(value) {\n const array = JSON.parse(value);\n if (!Array.isArray(array)) {\n throw new TypeError(`expected value of type \"array\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(array)}\"`);\n }\n return array;\n },\n boolean(value) {\n return !(value == \"0\" || String(value).toLowerCase() == \"false\");\n },\n number(value) {\n return Number(value.replace(/_/g, \"\"));\n },\n object(value) {\n const object = JSON.parse(value);\n if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n throw new TypeError(`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(object)}\"`);\n }\n return object;\n },\n string(value) {\n return value;\n },\n};\nconst writers = {\n default: writeString,\n array: writeJSON,\n object: writeJSON,\n};\nfunction writeJSON(value) {\n return JSON.stringify(value);\n}\nfunction writeString(value) {\n return `${value}`;\n}\n\nclass Controller {\n constructor(context) {\n this.context = context;\n }\n static get shouldLoad() {\n return true;\n }\n static afterLoad(_identifier, _application) {\n return;\n }\n get application() {\n return this.context.application;\n }\n get scope() {\n return this.context.scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get targets() {\n return this.scope.targets;\n }\n get outlets() {\n return this.scope.outlets;\n }\n get classes() {\n return this.scope.classes;\n }\n get data() {\n return this.scope.data;\n }\n initialize() {\n }\n connect() {\n }\n disconnect() {\n }\n dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true, } = {}) {\n const type = prefix ? `${prefix}:${eventName}` : eventName;\n const event = new CustomEvent(type, { detail, bubbles, cancelable });\n target.dispatchEvent(event);\n return event;\n }\n}\nController.blessings = [\n ClassPropertiesBlessing,\n TargetPropertiesBlessing,\n ValuePropertiesBlessing,\n OutletPropertiesBlessing,\n];\nController.targets = [];\nController.outlets = [];\nController.values = {};\n\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, SelectorObserver, StringMapObserver, TokenListObserver, ValueListObserver, add, defaultSchema, del, fetch, prune };\n", "import { Application } from '@hotwired/stimulus'\n\nconst application = Application.start()\n\n// Configure Stimulus development experience\napplication.debug = false\nwindow.Stimulus = application\n\nexport { application }\n", "export async function enter(element, transitionName = null) {\n element.classList.remove('hidden')\n await transition('enter', element, transitionName)\n}\n\nexport async function leave(element, transitionName = null) {\n await transition('leave', element, transitionName)\n element.classList.add('hidden')\n}\n\nexport async function toggle(element, transitionName = null) {\n if (element.classList.contains('hidden')) {\n await enter(element, transitionName)\n } else {\n await leave(element, transitionName)\n }\n}\n\nasync function transition(direction, element, animation) {\n const dataset = element.dataset\n const animationClass = animation ? `${animation}-${direction}` : direction\n let transition = `transition${direction.charAt(0).toUpperCase() + direction.slice(1)}`\n const genesis = dataset[transition] ? dataset[transition].split(\" \") : [animationClass]\n const start = dataset[`${transition}Start`] ? dataset[`${transition}Start`].split(\" \") : [`${animationClass}-start`]\n const end = dataset[`${transition}End`] ? dataset[`${transition}End`].split(\" \") : [`${animationClass}-end`]\n\n addClasses(element, genesis)\n addClasses(element, start)\n await nextFrame()\n removeClasses(element, start)\n addClasses(element, end);\n await afterTransition(element)\n removeClasses(element, end)\n removeClasses(element, genesis)\n}\n\nfunction addClasses(element, classes) {\n element.classList.add(...classes)\n}\n\nfunction removeClasses(element, classes) {\n element.classList.remove(...classes)\n}\n\nfunction nextFrame() {\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n requestAnimationFrame(resolve)\n });\n });\n}\n\nfunction afterTransition(element) {\n return new Promise(resolve => {\n // safari return string with comma separate values\n const computedDuration = getComputedStyle(element).transitionDuration.split(\",\")[0]\n const duration = Number(computedDuration.replace('s', '')) * 1000;\n setTimeout(() => {\n resolve()\n }, duration)\n });\n}", "import { Controller } from '@hotwired/stimulus'\nimport { enter, leave } from 'el-transition'\n\nexport default class extends Controller {\n static outlets = ['command-palette']\n\n static targets = ['navbar', 'sidebar', 'background', 'panel', 'overlay']\n\n toggleSidebar() {\n if (this.sidebarTarget.classList.contains('hidden')) {\n this.sidebarTarget.classList.remove('hidden')\n enter(this.backgroundTarget)\n enter(this.panelTarget)\n enter(this.overlayTarget)\n } else {\n Promise.all([\n leave(this.backgroundTarget),\n leave(this.panelTarget),\n leave(this.overlayTarget),\n ]).then(() => {\n this.sidebarTarget.classList.add('hidden')\n })\n }\n }\n\n toggleCommandPalette(event) {\n event.preventDefault()\n event.stopPropagation()\n this.commandPaletteOutlet.openValue = !this.commandPaletteOutlet.openValue\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['click']\n\n changeType() {\n this.clickTargets.forEach(target => target.click())\n }\n}\n", "/*!\n * Chart.js v3.9.1\n * https://www.chartjs.org\n * (c) 2022 Chart.js Contributors\n * Released under the MIT License\n */\nfunction noop() {}\nconst uid = (function() {\n let id = 0;\n return function() {\n return id++;\n };\n}());\nfunction isNullOrUndef(value) {\n return value === null || typeof value === 'undefined';\n}\nfunction isArray(value) {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\nconst isNumberFinite = (value) => (typeof value === 'number' || value instanceof Number) && isFinite(+value);\nfunction finiteOrDefault(value, defaultValue) {\n return isNumberFinite(value) ? value : defaultValue;\n}\nfunction valueOrDefault(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100\n : value / dimension;\nconst toDimension = (value, dimension) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100 * dimension\n : +value;\nfunction callback(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\nfunction _elementsEqual(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n return true;\n}\nfunction clone$1(source) {\n if (isArray(source)) {\n return source.map(clone$1);\n }\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for (; k < klen; ++k) {\n target[keys[k]] = clone$1(source[keys[k]]);\n }\n return target;\n }\n return source;\n}\nfunction isValidKey(key) {\n return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\nfunction _merger(key, target, source, options) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n merge(tval, sval, options);\n } else {\n target[key] = clone$1(sval);\n }\n}\nfunction merge(target, source, options) {\n const sources = isArray(source) ? source : [source];\n const ilen = sources.length;\n if (!isObject(target)) {\n return target;\n }\n options = options || {};\n const merger = options.merger || _merger;\n for (let i = 0; i < ilen; ++i) {\n source = sources[i];\n if (!isObject(source)) {\n continue;\n }\n const keys = Object.keys(source);\n for (let k = 0, klen = keys.length; k < klen; ++k) {\n merger(keys[k], target, source, options);\n }\n }\n return target;\n}\nfunction mergeIf(target, source) {\n return merge(target, source, {merger: _mergerIf});\n}\nfunction _mergerIf(key, target, source) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone$1(sval);\n }\n}\nfunction _deprecated(scope, value, previous, current) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous +\n\t\t\t'\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\nconst keyResolvers = {\n '': v => v,\n x: o => o.x,\n y: o => o.y\n};\nfunction resolveObjectKey(obj, key) {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\nfunction _getKeyResolver(key) {\n const keys = _splitKey(key);\n return obj => {\n for (const k of keys) {\n if (k === '') {\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction _splitKey(key) {\n const parts = key.split('.');\n const keys = [];\n let tmp = '';\n for (const part of parts) {\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\nfunction _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value) => typeof value !== 'undefined';\nconst isFunction = (value) => typeof value === 'function';\nconst setsEqual = (a, b) => {\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n};\nfunction _isClickEvent(e) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\nconst PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction niceNum(range) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\nfunction _factorize(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for (i = 1; i < sqrt; i++) {\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) {\n result.push(sqrt);\n }\n result.sort((a, b) => a - b).pop();\n return result;\n}\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostEquals(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\nfunction almostWhole(x, epsilon) {\n const rounded = Math.round(x);\n return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\nfunction _setMinAndMaxByKey(array, target, property) {\n let i, ilen, value;\n for (i = 0, ilen = array.length; i < ilen; i++) {\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction toRadians(degrees) {\n return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n return radians * (180 / PI);\n}\nfunction _decimalPlaces(x) {\n if (!isNumberFinite(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while (Math.round(x * e) / e !== x) {\n e *= 10;\n p++;\n }\n return p;\n}\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < (-0.5 * PI)) {\n angle += TAU;\n }\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\nfunction _angleDiff(a, b) {\n return (a - b + PITAU) % TAU - PI;\n}\nfunction _normalizeAngle(a) {\n return (a % TAU + TAU) % TAU;\n}\nfunction _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || (sameAngleIsFullCircle && s === e)\n || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\nfunction _limitValue(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\nfunction _int16Range(value) {\n return _limitValue(value, -32768, 32767);\n}\nfunction _isBetween(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nfunction _lookup(table, value, cmp) {\n cmp = cmp || ((index) => table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while (hi - lo > 1) {\n mid = (lo + hi) >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return {lo, hi};\n}\nconst _lookupByKey = (table, key, value, last) =>\n _lookup(table, value, last\n ? index => table[index][key] <= value\n : index => table[index][key] < value);\nconst _rlookupByKey = (table, key, value) =>\n _lookup(table, value, index => table[index][key] >= value);\nfunction _filterBetween(values, min, max) {\n let start = 0;\n let end = values.length;\n while (start < end && values[start] < min) {\n start++;\n }\n while (end > start && values[end - 1] > max) {\n end--;\n }\n return start > 0 || end < values.length\n ? values.slice(start, end)\n : values;\n}\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\nfunction listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n arrayEvents.forEach((key) => {\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value(...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object) => {\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n return res;\n }\n });\n });\n}\nfunction unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length > 0) {\n return;\n }\n arrayEvents.forEach((key) => {\n delete array[key];\n });\n delete array._chartjs;\n}\nfunction _arrayUnique(items) {\n const set = new Set();\n let i, ilen;\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n set.add(items[i]);\n }\n if (set.size === ilen) {\n return items;\n }\n return Array.from(set);\n}\n\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\nconst requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}());\nfunction throttled(fn, thisArg, updateFn) {\n const updateArgs = updateFn || ((args) => Array.prototype.slice.call(args));\n let ticking = false;\n let args = [];\n return function(...rest) {\n args = updateArgs(rest);\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, () => {\n ticking = false;\n fn.apply(thisArg, args);\n });\n }\n };\n}\nfunction debounce(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\nconst _toLeftRightCenter = (align) => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\nconst _alignStartEnd = (align, start, end) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\nconst _textX = (align, left, right, rtl) => {\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\nfunction _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const {iScale, _parsed} = meta;\n const axis = iScale.axis;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(Math.min(\n _lookupByKey(_parsed, iScale.axis, min).lo,\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1),\n start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n return {start, count};\n}\nfunction _scaleRangesChanged(meta) {\n const {xScale, yScale, _scaleRanges} = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n\nconst atEdge = (t) => t === 0 || t === 1;\nconst elasticIn = (t, s, p) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\nconst effects = {\n linear: t => t,\n easeInQuad: t => t * t,\n easeOutQuad: t => -t * (t - 2),\n easeInOutQuad: t => ((t /= 0.5) < 1)\n ? 0.5 * t * t\n : -0.5 * ((--t) * (t - 2) - 1),\n easeInCubic: t => t * t * t,\n easeOutCubic: t => (t -= 1) * t * t + 1,\n easeInOutCubic: t => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t\n : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: t => t * t * t * t,\n easeOutQuart: t => -((t -= 1) * t * t * t - 1),\n easeInOutQuart: t => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t\n : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: t => t * t * t * t * t,\n easeOutQuint: t => (t -= 1) * t * t * t * t + 1,\n easeInOutQuint: t => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t * t\n : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: t => -Math.cos(t * HALF_PI) + 1,\n easeOutSine: t => Math.sin(t * HALF_PI),\n easeInOutSine: t => -0.5 * (Math.cos(PI * t) - 1),\n easeInExpo: t => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: t => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: t => atEdge(t) ? t : t < 0.5\n ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: t => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: t => Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: t => ((t /= 0.5) < 1)\n ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: t => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n easeOutElastic: t => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n easeInOutElastic(t) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t :\n t < 0.5\n ? 0.5 * elasticIn(t * 2, s, p)\n : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n easeInBack(t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack(t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack(t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n easeInBounce: t => 1 - effects.easeOutBounce(1 - t),\n easeOutBounce(t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < (1 / d)) {\n return m * t * t;\n }\n if (t < (2 / d)) {\n return m * (t -= (1.5 / d)) * t + 0.75;\n }\n if (t < (2.5 / d)) {\n return m * (t -= (2.25 / d)) * t + 0.9375;\n }\n return m * (t -= (2.625 / d)) * t + 0.984375;\n },\n easeInOutBounce: t => (t < 0.5)\n ? effects.easeInBounce(t * 2) * 0.5\n : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n};\n\n/*!\n * @kurkle/color v0.2.1\n * https://github.com/kurkle/color#readme\n * (c) 2022 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n return lim(round(v * 2.55), 0, 255);\n}\nfunction n2b(v) {\n return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n return lim(round(v * 100), 0, 100);\n}\nconst map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n var len = str.length;\n var ret;\n if (str[0] === '#') {\n if (len === 4 || len === 5) {\n ret = {\n r: 255 & map$1[str[1]] * 17,\n g: 255 & map$1[str[2]] * 17,\n b: 255 & map$1[str[3]] * 17,\n a: len === 5 ? map$1[str[4]] * 17 : 255\n };\n } else if (len === 7 || len === 9) {\n ret = {\n r: map$1[str[1]] << 4 | map$1[str[2]],\n g: map$1[str[3]] << 4 | map$1[str[4]],\n b: map$1[str[5]] << 4 | map$1[str[6]],\n a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n };\n }\n }\n return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n var f = isShort(v) ? h1 : h2;\n return v\n ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n : undefined;\n}\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n const rgb = hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for (i = 0; i < 3; i++) {\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n if (r === max) {\n return ((g - b) / d) + (g < b ? 6 : 0);\n }\n if (g === max) {\n return (b - r) / d + 2;\n }\n return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n return (\n Array.isArray(a)\n ? f(a[0], a[1], a[2])\n : f(a, b, c)\n ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n const m = HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) {\n return;\n }\n if (m[5] !== v) {\n a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n }\n const h = hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === 'hwb') {\n v = hwb2rgb(h, p1, p2);\n } else if (m[1] === 'hsv') {\n v = hsv2rgb(h, p1, p2);\n } else {\n v = hsl2rgb(h, p1, p2);\n }\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction rotate(v, deg) {\n var h = rgb2hsl(v);\n h[0] = hue(h[0] + deg);\n h = hsl2rgb(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction hslString(v) {\n if (!v) {\n return;\n }\n const a = rgb2hsl(v);\n const h = a[0];\n const s = n2p(a[1]);\n const l = n2p(a[2]);\n return v.a < 255\n ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n : `hsl(${h}, ${s}%, ${l}%)`;\n}\nconst map = {\n x: 'dark',\n Z: 'light',\n Y: 're',\n X: 'blu',\n W: 'gr',\n V: 'medium',\n U: 'slate',\n A: 'ee',\n T: 'ol',\n S: 'or',\n B: 'ra',\n C: 'lateg',\n D: 'ights',\n R: 'in',\n Q: 'turquois',\n E: 'hi',\n P: 'ro',\n O: 'al',\n N: 'le',\n M: 'de',\n L: 'yello',\n F: 'en',\n K: 'ch',\n G: 'arks',\n H: 'ea',\n I: 'ightg',\n J: 'wh'\n};\nconst names$1 = {\n OiceXe: 'f0f8ff',\n antiquewEte: 'faebd7',\n aqua: 'ffff',\n aquamarRe: '7fffd4',\n azuY: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '0',\n blanKedOmond: 'ffebcd',\n Xe: 'ff',\n XeviTet: '8a2be2',\n bPwn: 'a52a2a',\n burlywood: 'deb887',\n caMtXe: '5f9ea0',\n KartYuse: '7fff00',\n KocTate: 'd2691e',\n cSO: 'ff7f50',\n cSnflowerXe: '6495ed',\n cSnsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: 'ffff',\n xXe: '8b',\n xcyan: '8b8b',\n xgTMnPd: 'b8860b',\n xWay: 'a9a9a9',\n xgYF: '6400',\n xgYy: 'a9a9a9',\n xkhaki: 'bdb76b',\n xmagFta: '8b008b',\n xTivegYF: '556b2f',\n xSange: 'ff8c00',\n xScEd: '9932cc',\n xYd: '8b0000',\n xsOmon: 'e9967a',\n xsHgYF: '8fbc8f',\n xUXe: '483d8b',\n xUWay: '2f4f4f',\n xUgYy: '2f4f4f',\n xQe: 'ced1',\n xviTet: '9400d3',\n dAppRk: 'ff1493',\n dApskyXe: 'bfff',\n dimWay: '696969',\n dimgYy: '696969',\n dodgerXe: '1e90ff',\n fiYbrick: 'b22222',\n flSOwEte: 'fffaf0',\n foYstWAn: '228b22',\n fuKsia: 'ff00ff',\n gaRsbSo: 'dcdcdc',\n ghostwEte: 'f8f8ff',\n gTd: 'ffd700',\n gTMnPd: 'daa520',\n Way: '808080',\n gYF: '8000',\n gYFLw: 'adff2f',\n gYy: '808080',\n honeyMw: 'f0fff0',\n hotpRk: 'ff69b4',\n RdianYd: 'cd5c5c',\n Rdigo: '4b0082',\n ivSy: 'fffff0',\n khaki: 'f0e68c',\n lavFMr: 'e6e6fa',\n lavFMrXsh: 'fff0f5',\n lawngYF: '7cfc00',\n NmoncEffon: 'fffacd',\n ZXe: 'add8e6',\n ZcSO: 'f08080',\n Zcyan: 'e0ffff',\n ZgTMnPdLw: 'fafad2',\n ZWay: 'd3d3d3',\n ZgYF: '90ee90',\n ZgYy: 'd3d3d3',\n ZpRk: 'ffb6c1',\n ZsOmon: 'ffa07a',\n ZsHgYF: '20b2aa',\n ZskyXe: '87cefa',\n ZUWay: '778899',\n ZUgYy: '778899',\n ZstAlXe: 'b0c4de',\n ZLw: 'ffffe0',\n lime: 'ff00',\n limegYF: '32cd32',\n lRF: 'faf0e6',\n magFta: 'ff00ff',\n maPon: '800000',\n VaquamarRe: '66cdaa',\n VXe: 'cd',\n VScEd: 'ba55d3',\n VpurpN: '9370db',\n VsHgYF: '3cb371',\n VUXe: '7b68ee',\n VsprRggYF: 'fa9a',\n VQe: '48d1cc',\n VviTetYd: 'c71585',\n midnightXe: '191970',\n mRtcYam: 'f5fffa',\n mistyPse: 'ffe4e1',\n moccasR: 'ffe4b5',\n navajowEte: 'ffdead',\n navy: '80',\n Tdlace: 'fdf5e6',\n Tive: '808000',\n TivedBb: '6b8e23',\n Sange: 'ffa500',\n SangeYd: 'ff4500',\n ScEd: 'da70d6',\n pOegTMnPd: 'eee8aa',\n pOegYF: '98fb98',\n pOeQe: 'afeeee',\n pOeviTetYd: 'db7093',\n papayawEp: 'ffefd5',\n pHKpuff: 'ffdab9',\n peru: 'cd853f',\n pRk: 'ffc0cb',\n plum: 'dda0dd',\n powMrXe: 'b0e0e6',\n purpN: '800080',\n YbeccapurpN: '663399',\n Yd: 'ff0000',\n Psybrown: 'bc8f8f',\n PyOXe: '4169e1',\n saddNbPwn: '8b4513',\n sOmon: 'fa8072',\n sandybPwn: 'f4a460',\n sHgYF: '2e8b57',\n sHshell: 'fff5ee',\n siFna: 'a0522d',\n silver: 'c0c0c0',\n skyXe: '87ceeb',\n UXe: '6a5acd',\n UWay: '708090',\n UgYy: '708090',\n snow: 'fffafa',\n sprRggYF: 'ff7f',\n stAlXe: '4682b4',\n tan: 'd2b48c',\n teO: '8080',\n tEstN: 'd8bfd8',\n tomato: 'ff6347',\n Qe: '40e0d0',\n viTet: 'ee82ee',\n JHt: 'f5deb3',\n wEte: 'ffffff',\n wEtesmoke: 'f5f5f5',\n Lw: 'ffff00',\n LwgYF: '9acd32'\n};\nfunction unpack() {\n const unpacked = {};\n const keys = Object.keys(names$1);\n const tkeys = Object.keys(map);\n let i, j, k, ok, nk;\n for (i = 0; i < keys.length; i++) {\n ok = nk = keys[i];\n for (j = 0; j < tkeys.length; j++) {\n k = tkeys[j];\n nk = nk.replace(k, map[k]);\n }\n k = parseInt(names$1[ok], 16);\n unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n }\n return unpacked;\n}\nlet names;\nfunction nameParse(str) {\n if (!names) {\n names = unpack();\n names.transparent = [0, 0, 0, 0];\n }\n const a = names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n const m = RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) {\n return;\n }\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction rgbString(v) {\n return v && (\n v.a < 255\n ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n : `rgb(${v.r}, ${v.g}, ${v.b})`\n );\n}\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n const r = from(b2n(rgb1.r));\n const g = from(b2n(rgb1.g));\n const b = from(b2n(rgb1.b));\n return {\n r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\nfunction modHSL(v, i, ratio) {\n if (v) {\n let tmp = rgb2hsl(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = hsl2rgb(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n var v = {r: 0, g: 0, b: 0, a: 255};\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {r: input[0], g: input[1], b: input[2], a: 255};\n if (input.length > 3) {\n v.a = n2b(input[3]);\n }\n }\n } else {\n v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n v.a = n2b(v.a);\n }\n return v;\n}\nfunction functionParse(str) {\n if (str.charAt(0) === 'r') {\n return rgbParse(str);\n }\n return hueParse(str);\n}\nclass Color {\n constructor(input) {\n if (input instanceof Color) {\n return input;\n }\n const type = typeof input;\n let v;\n if (type === 'object') {\n v = fromObject(input);\n } else if (type === 'string') {\n v = hexParse(input) || nameParse(input) || functionParse(input);\n }\n this._rgb = v;\n this._valid = !!v;\n }\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = clone(this._rgb);\n if (v) {\n v.a = b2n(v.a);\n }\n return v;\n }\n set rgb(obj) {\n this._rgb = fromObject(obj);\n }\n rgbString() {\n return this._valid ? rgbString(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? hexString(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? hslString(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) {\n this._rgb = interpolate(this._rgb, color._rgb, t);\n }\n return this;\n }\n clone() {\n return new Color(this.rgb);\n }\n alpha(a) {\n this._rgb.a = n2b(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n rotate(this._rgb, deg);\n return this;\n }\n}\nfunction index_esm(input) {\n return new Color(input);\n}\n\nfunction isPatternOrGradient(value) {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n return false;\n}\nfunction color(value) {\n return isPatternOrGradient(value) ? value : index_esm(value);\n}\nfunction getHoverColor(value) {\n return isPatternOrGradient(value)\n ? value\n : index_esm(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\nfunction getScope$1(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for (let i = 0, n = keys.length; i < n; ++i) {\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope$1(root, scope), values);\n }\n return merge(getScope$1(root, ''), scope);\n}\nclass Defaults {\n constructor(_descriptors) {\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options) => getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n }\n set(scope, values) {\n return set(this, scope, values);\n }\n get(scope) {\n return getScope$1(this, scope);\n }\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n override(scope, values) {\n return set(overrides, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope$1(this, scope);\n const targetScopeObject = getScope$1(this, targetScope);\n const privateName = '_' + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get() {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set(value) {\n this[privateName] = value;\n }\n }\n });\n }\n}\nvar defaults = new Defaults({\n _scriptable: (name) => !name.startsWith('on'),\n _indexable: (name) => name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false,\n }\n});\n\nfunction toFontString(font) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\nfunction _measureText(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for (i = 0; i < ilen; i++) {\n thing = arrayOfThings[i];\n if (thing !== undefined && thing !== null && isArray(thing) !== true) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n for (j = 0, jlen = thing.length; j < jlen; j++) {\n nestedThing = thing[j];\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\nfunction _alignPixel(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\nfunction clearCanvas(canvas, ctx) {\n ctx = ctx || canvas.getContext('2d');\n ctx.save();\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n drawPointLegend(ctx, options, x, y, null);\n}\nfunction drawPointLegend(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n ctx.beginPath();\n switch (style) {\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n ctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n ctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n case 'rectRot':\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + yOffset, y - xOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.lineTo(x - yOffset, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n case 'cross':\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x + yOffset, y - xOffset);\n ctx.lineTo(x - yOffset, y + xOffset);\n break;\n case 'star':\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x + yOffset, y - xOffset);\n ctx.lineTo(x - yOffset, y + xOffset);\n rad += QUARTER_PI;\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x + yOffset, y - xOffset);\n ctx.lineTo(x - yOffset, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\nfunction _isPointInArea(point, area, margin) {\n margin = margin || 0.5;\n return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\nfunction clipArea(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction unclipArea(ctx) {\n ctx.restore();\n}\nfunction _steppedLineTo(ctx, previous, target, flip, mode) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\nfunction _bezierCurveTo(ctx, previous, target, flip) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(\n flip ? previous.cp1x : previous.cp2x,\n flip ? previous.cp1y : previous.cp2y,\n flip ? target.cp2x : target.cp1x,\n flip ? target.cp2y : target.cp1y,\n target.x,\n target.y);\n}\nfunction renderText(ctx, text, x, y, font, opts = {}) {\n const lines = isArray(text) ? text : [text];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i, line;\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n for (i = 0; i < lines.length; ++i) {\n line = lines[i];\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n y += font.lineHeight;\n }\n ctx.restore();\n}\nfunction setRenderOpts(ctx, opts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction addRoundedRectPath(ctx, rect) {\n const {x, y, w, h, radius} = rect;\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);\n ctx.lineTo(x, y + h - radius.bottomLeft);\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n ctx.lineTo(x + w, y + radius.topRight);\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = new RegExp(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\nconst FONT_STYLE = new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);\nfunction toLineHeight(value, size) {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n value = +matches[2];\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n }\n return size * value;\n}\nconst numberOrZero = v => +v || 0;\nfunction _readValueToProps(value, props) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value)\n ? objProps\n ? prop => valueOrDefault(value[prop], value[props[prop]])\n : prop => value[prop]\n : () => value;\n for (const prop of keys) {\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\nfunction toTRBL(value) {\n return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\nfunction toTRBLCorners(value) {\n return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\nfunction toPadding(value) {\n const obj = toTRBL(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\nfunction toFont(options, fallback) {\n options = options || {};\n fallback = fallback || defaults.font;\n let size = valueOrDefault(options.size, fallback.size);\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = '';\n }\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n font.string = toFontString(font);\n return font;\n}\nfunction resolve(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\nfunction _addGrace(minmax, grace, beginAtZero) {\n const {min, max} = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value, add) => beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction createContext(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n\nfunction _createResolver(scopes, prefixes = [''], rootScopes = scopes, fallback, getTarget = () => scopes[0]) {\n if (!defined(fallback)) {\n fallback = _resolve('_fallback', scopes);\n }\n const cache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: rootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope) => _createResolver([scope, ...scopes], prefixes, rootScopes, fallback),\n };\n return new Proxy(cache, {\n deleteProperty(target, prop) {\n delete target[prop];\n delete target._keys;\n delete scopes[0][prop];\n return true;\n },\n get(target, prop) {\n return _cached(target, prop,\n () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n getPrototypeOf() {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n has(target, prop) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n ownKeys(target) {\n return getKeysFromAllScopes(target);\n },\n set(target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value;\n delete target._keys;\n return true;\n }\n });\n}\nfunction _attachContext(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n deleteProperty(target, prop) {\n delete target[prop];\n delete proxy[prop];\n return true;\n },\n get(target, prop, receiver) {\n return _cached(target, prop,\n () => _resolveWithContext(target, prop, receiver));\n },\n getOwnPropertyDescriptor(target, prop) {\n return target._descriptors.allKeys\n ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n getPrototypeOf() {\n return Reflect.getPrototypeOf(proxy);\n },\n has(target, prop) {\n return Reflect.has(proxy, prop);\n },\n ownKeys() {\n return Reflect.ownKeys(proxy);\n },\n set(target, prop, value) {\n proxy[prop] = value;\n delete target[prop];\n return true;\n }\n });\n}\nfunction _descriptors(proxy, defaults = {scriptable: true, indexable: true}) {\n const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n };\n}\nconst readKey = (prefix, name) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value) => isObject(value) && prop !== 'adapters' &&\n (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n const value = resolve();\n target[prop] = value;\n return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n let value = _proxy[prop];\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\nfunction _resolveScriptable(prop, value, target, receiver) {\n const {_proxy, _context, _subProxy, _stack} = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n value = value(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n if (defined(_context.index) && isIndexable(prop)) {\n value = value[_context.index % value.length];\n } else if (isObject(value[0])) {\n const arr = value;\n const scopes = _proxy._scopes.filter(s => s !== arr);\n value = [];\n for (const item of arr) {\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent) => key === true ? parent\n : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes) {\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (defined(fallback) && fallback !== key && fallback !== parentFallback) {\n return fallback;\n }\n } else if (scope === false && defined(parentFallback) && key !== parentFallback) {\n return null;\n }\n }\n return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [...parentScopes, ...rootScopes];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (defined(fallback) && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [''], rootScopes, fallback,\n () => subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n while (key) {\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n return value;\n }\n return target;\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes) {\n value = _resolve(readKey(prefix, prop), scopes);\n if (defined(value)) {\n return needsSubResolver(prop, value)\n ? createSubResolver(scopes, proxy, prop, value)\n : value;\n }\n }\n}\nfunction _resolve(key, scopes) {\n for (const scope of scopes) {\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (defined(value)) {\n return value;\n }\n }\n}\nfunction getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes) {\n for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n set.add(key);\n }\n }\n return Array.from(set);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n const {iScale} = meta;\n const {key = 'r'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i) => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis) => indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01;\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\nfunction monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\nfunction splineCurveMonotone(points, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n let i, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for (i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i]\n : !pointAfter ? deltaK[i - 1]\n : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n monotoneAdjust(points, deltaK, mK);\n monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\nfunction _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n if (options.spanGaps) {\n points = points.filter((pt) => !pt.skip);\n }\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n controlPoints = splineCurve(\n prev,\n point,\n points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n options.tension\n );\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n\nfunction _isDomSupported() {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\nfunction _getParentNode(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = parent.host;\n }\n return parent;\n}\nfunction parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf('%') !== -1) {\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n return valueInPixels;\n}\nconst getComputedStyle = (element) => window.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? '-' + suffix : '';\n for (let i = 0; i < 4; i++) {\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst useOffsetPos = (x, y, target) => (x > 0 || y > 0) && (!target || !target.shadowRoot);\nfunction getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const {offsetX, offsetY} = source;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {x, y, box};\n}\nfunction getRelativePosition(evt, chart) {\n if ('native' in evt) {\n return evt;\n }\n const {canvas, currentDevicePixelRatio} = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const {x, y, box} = getCanvasPosition(evt, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let {width, height} = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect();\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\nconst round1 = v => Math.round(v * 10) / 10;\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let {width, height} = containerSize;\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n height = round1(width / 2);\n }\n return {\n width,\n height\n };\n}\nfunction retinaScale(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = deviceHeight / pixelRatio;\n chart.width = deviceWidth / pixelRatio;\n const canvas = chart.canvas;\n if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio\n || canvas.height !== deviceHeight\n || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\nconst supportsEventListenerOptions = (function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive() {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n }\n return passiveSupported;\n}());\nfunction readUsedSize(element, property) {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n\nfunction _pointInLine(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\nfunction _steppedInterpolation(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n : mode === 'after' ? t < 1 ? p1.y : p2.y\n : t > 0 ? p2.y : p1.y\n };\n}\nfunction _bezierInterpolation(p1, p2, t, mode) {\n const cp1 = {x: p1.cp2x, y: p1.cp2y};\n const cp2 = {x: p2.cp1x, y: p2.cp1y};\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction formatNumber(num, locale, options) {\n return getNumberFormat(locale, options).format(num);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n return {\n x(x) {\n return rectX + rectX + width - x;\n },\n setWidth(w) {\n width = w;\n },\n textAlign(align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus(x, value) {\n return x - value;\n },\n leftForLtr(x, itemWidth) {\n return x - itemWidth;\n },\n };\n};\nconst getLeftToRightAdapter = function() {\n return {\n x(x) {\n return x;\n },\n setWidth(w) {\n },\n textAlign(align) {\n return align;\n },\n xPlus(x, value) {\n return x + value;\n },\n leftForLtr(x, _itemWidth) {\n return x;\n },\n };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n let style, original;\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'),\n ];\n style.setProperty('direction', direction, 'important');\n ctx.prevTextDirection = original;\n }\n}\nfunction restoreTextDirection(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle,\n };\n }\n return {\n between: _isBetween,\n compare: (a, b) => a - b,\n normalize: x => x\n };\n}\nfunction normalizeSegment({start, end, count, loop, style}) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\nfunction getSegment(segment, points, bounds) {\n const {property, start: startBound, end: endBound} = bounds;\n const {between, normalize} = propertyFn(property);\n const count = points.length;\n let {start, end, loop} = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for (i = 0, ilen = count; i < ilen; ++i) {\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) {\n end += count;\n }\n return {start, end, loop, style: segment.style};\n}\nfunction _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [segment];\n }\n const {property, start: startBound, end: endBound} = bounds;\n const count = points.length;\n const {compare, between, normalize} = propertyFn(property);\n const {start, end, loop, style} = getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = () => inside || startIsBefore();\n const shouldStop = () => !inside || endIsBefore();\n for (let i = start, prev = start; i <= end; ++i) {\n point = points[i % count];\n if (point.skip) {\n continue;\n }\n value = normalize(point[property]);\n if (value === prevValue) {\n continue;\n }\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) {\n result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n }\n return result;\n}\nfunction _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n for (let i = 0; i < segments.length; i++) {\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) {\n while (start < count && !points[start].skip) {\n start++;\n }\n }\n while (start < count && points[start].skip) {\n start++;\n }\n start %= count;\n if (loop) {\n end += start;\n }\n while (end > start && points[end % count].skip) {\n end--;\n }\n end %= count;\n return {start, end};\n}\nfunction solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for (end = start + 1; end <= max; ++end) {\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({start: start % count, end: (end - 1) % count, loop});\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n if (last !== null) {\n result.push({start: start % count, end: last % count, loop});\n }\n return result;\n}\nfunction _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) {\n return [];\n }\n const loop = !!line._loop;\n const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) {\n return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n }\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\nfunction splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n s += count;\n while (points[s % count].skip) {\n s -= dir;\n }\n while (points[e % count].skip) {\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({start: s % count, end: e % count, loop: l, style: st});\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments) {\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for (i = start + 1; i <= segment.end; i++) {\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n return result;\n}\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction styleChanged(style, prevStyle) {\n return prevStyle && JSON.stringify(style) !== JSON.stringify(prevStyle);\n}\n\nexport { _isPointInArea as $, _factorize as A, finiteOrDefault as B, callback as C, _addGrace as D, _limitValue as E, toDegrees as F, _measureText as G, HALF_PI as H, _int16Range as I, _alignPixel as J, toPadding as K, clipArea as L, renderText as M, unclipArea as N, toFont as O, PI as P, each as Q, _toLeftRightCenter as R, _alignStartEnd as S, TAU as T, overrides as U, merge as V, _capitalize as W, getRelativePosition as X, _rlookupByKey as Y, _lookupByKey as Z, _arrayUnique as _, resolve as a, toLineHeight as a$, getAngleFromPoint as a0, getMaximumSize as a1, _getParentNode as a2, readUsedSize as a3, throttled as a4, supportsEventListenerOptions as a5, _isDomSupported as a6, descriptors as a7, isFunction as a8, _attachContext as a9, getRtlAdapter as aA, overrideTextDirection as aB, _textX as aC, restoreTextDirection as aD, drawPointLegend as aE, noop as aF, distanceBetweenPoints as aG, _setMinAndMaxByKey as aH, niceNum as aI, almostWhole as aJ, almostEquals as aK, _decimalPlaces as aL, _longestText as aM, _filterBetween as aN, _lookup as aO, isPatternOrGradient as aP, getHoverColor as aQ, clone$1 as aR, _merger as aS, _mergerIf as aT, _deprecated as aU, _splitKey as aV, toFontString as aW, splineCurve as aX, splineCurveMonotone as aY, getStyle as aZ, fontString as a_, _createResolver as aa, _descriptors as ab, mergeIf as ac, uid as ad, debounce as ae, retinaScale as af, clearCanvas as ag, setsEqual as ah, _elementsEqual as ai, _isClickEvent as aj, _isBetween as ak, _readValueToProps as al, _updateBezierControlPoints as am, _computeSegments as an, _boundSegments as ao, _steppedInterpolation as ap, _bezierInterpolation as aq, _pointInLine as ar, _steppedLineTo as as, _bezierCurveTo as at, drawPoint as au, addRoundedRectPath as av, toTRBL as aw, toTRBLCorners as ax, _boundSegment as ay, _normalizeAngle as az, isArray as b, PITAU as b0, INFINITY as b1, RAD_PER_DEG as b2, QUARTER_PI as b3, TWO_THIRDS_PI as b4, _angleDiff as b5, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, createContext as h, isObject as i, defined as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, _getStartAndCountOfVisiblePoints as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _scaleRangesChanged as w, isNumber as x, _parseObjectDataRadialScale as y, log10 as z };\n", "/*!\n * Chart.js v3.9.1\n * https://www.chartjs.org\n * (c) 2022 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, d as defaults, i as isObject, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as createContext, j as defined, s as sign, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as _getStartAndCountOfVisiblePoints, w as _scaleRangesChanged, x as isNumber, y as _parseObjectDataRadialScale, z as log10, A as _factorize, B as finiteOrDefault, C as callback, D as _addGrace, E as _limitValue, F as toDegrees, G as _measureText, I as _int16Range, J as _alignPixel, K as toPadding, L as clipArea, M as renderText, N as unclipArea, O as toFont, Q as each, R as _toLeftRightCenter, S as _alignStartEnd, U as overrides, V as merge, W as _capitalize, X as getRelativePosition, Y as _rlookupByKey, Z as _lookupByKey, $ as _isPointInArea, a0 as getAngleFromPoint, a1 as getMaximumSize, a2 as _getParentNode, a3 as readUsedSize, a4 as throttled, a5 as supportsEventListenerOptions, a6 as _isDomSupported, a7 as descriptors, a8 as isFunction, a9 as _attachContext, aa as _createResolver, ab as _descriptors, ac as mergeIf, ad as uid, ae as debounce, af as retinaScale, ag as clearCanvas, ah as setsEqual, ai as _elementsEqual, aj as _isClickEvent, ak as _isBetween, al as _readValueToProps, am as _updateBezierControlPoints, an as _computeSegments, ao as _boundSegments, ap as _steppedInterpolation, aq as _bezierInterpolation, ar as _pointInLine, as as _steppedLineTo, at as _bezierCurveTo, au as drawPoint, av as addRoundedRectPath, aw as toTRBL, ax as toTRBLCorners, ay as _boundSegment, az as _normalizeAngle, aA as getRtlAdapter, aB as overrideTextDirection, aC as _textX, aD as restoreTextDirection, aE as drawPointLegend, aF as noop, aG as distanceBetweenPoints, aH as _setMinAndMaxByKey, aI as niceNum, aJ as almostWhole, aK as almostEquals, aL as _decimalPlaces, aM as _longestText, aN as _filterBetween, aO as _lookup } from './chunks/helpers.segment.mjs';\nexport { d as defaults } from './chunks/helpers.segment.mjs';\n\nclass Animator {\n constructor() {\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach(fn => fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n this._request = requestAnimFrame.call(window, () => {\n this._update();\n this._request = null;\n if (this._running) {\n this._refresh();\n }\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart) => {\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for (; i >= 0; --i) {\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) {\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) {\n this._running = false;\n }\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n for (; i >= 0; --i) {\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\nvar animator = new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean(from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color(from, to, factor) {\n const c0 = color(from || transparent);\n const c1 = c0.valid && color(to || transparent);\n return c1 && c1.valid\n ? c1.mix(c0, factor).hexString()\n : to;\n },\n number(from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass Animation {\n constructor(cfg, target, prop, to) {\n const currentValue = target[prop];\n to = resolve([cfg.to, to, currentValue, cfg.from]);\n const from = resolve([cfg.from, currentValue, to]);\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n this._from = resolve([cfg.from, currentValue, to]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || (elapsed < duration));\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = (elapsed / duration) % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej) => {\n promises.push({res, rej});\n });\n }\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for (let i = 0; i < promises.length; i++) {\n promises[i][method]();\n }\n }\n}\n\nconst numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\ndefaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined,\n});\nconst animationOptions = Object.keys(defaults.animation);\ndefaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n});\ndefaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n },\n});\ndefaults.describe('animations', {\n _fallback: 'animation',\n});\ndefaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0\n },\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: v => v | 0\n },\n }\n }\n});\nclass Animations {\n constructor(chart, config) {\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach(key => {\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions) {\n resolved[option] = cfg[option];\n }\n (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n awaitAll(target.options.$animations, newOptions).then(() => {\n target.options = newOptions;\n }, () => {\n });\n }\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for (i = props.length - 1; i >= 0; --i) {\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i++) {\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n }\n return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction toClip(value) {\n let t, r, b, l;\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n keys.push(metasets[i].index);\n }\n return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n if (value === null) {\n return;\n }\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isNumberFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n value += otherValue;\n }\n }\n return value;\n}\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || (stacked === undefined && meta.stack !== undefined);\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n const value = stack[meta.index];\n if ((positive && value > 0) || (!positive && value < 0)) {\n return meta.index;\n }\n }\n return null;\n}\nfunction updateStacks(controller, parsed) {\n const {chart, _cachedMeta: meta} = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const {iScale, vScale, index: datasetIndex} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for (let i = 0; i < ilen; ++i) {\n const item = parsed[i];\n const {[iAxis]: index, [vAxis]: value} = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n }\n}\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n return createContext(parent,\n {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n }\n );\n}\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\nfunction clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n items = items || meta._parsed;\n for (const parsed of items) {\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n }\n}\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n && {keys: getSortedDatasetIndices(chart, true), values: null};\nclass DatasetController {\n constructor(chart, datasetIndex) {\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.initialize();\n }\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale\n ? meta.vScale\n : meta.iScale;\n }\n reset() {\n this._update('reset');\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n unlistenArrayEvents(_data, this);\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const {_cachedMeta: meta, _data: data} = this;\n const {iScale, _stacked} = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n for (i = 0; i < count; ++i) {\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n parsePrimitiveData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]\n };\n return applyStack(stack, value, meta.index, {mode});\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for (i = 0; i < ilen; ++i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n break;\n }\n }\n if (sorted) {\n for (i = ilen - 1; i >= 0; --i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n value = parsed[i][scale.axis];\n if (isNumberFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || (elements.length - start);\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n for (i = start; i < start + count; ++i) {\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n for (i = 0; i < active.length; ++i) {\n active[i].draw(ctx, area);\n }\n }\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset\n ? this.resolveDatasetElementOptions(mode)\n : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context ||\n (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context ||\n (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n const context = () => this.getContext(index, active);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || (sharedOptions !== previouslySharedOptions);\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {sharedOptions, includeOptions};\n }\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: (!active && this.getSharedOptions(options)) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList) {\n this[method](arg1, arg2);\n }\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) {\n this.parse(0, count);\n }\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr) => {\n arr.length += count;\n for (i = arr.length - 1; i >= end; i--) {\n arr[i] = arr[i - count];\n }\n };\n move(data);\n for (i = start; i < end; ++i) {\n data[i] = new this.dataElementType();\n }\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([this.index, ...args]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n }\n _onDataPop() {\n this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n }\n _onDataShift() {\n this._sync(['_removeElements', 0, 1]);\n }\n _onDataSplice(start, count) {\n if (count) {\n this._sync(['_removeElements', start, count]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync(['_insertElements', start, newCount]);\n }\n }\n _onDataUnshift() {\n this._sync(['_insertElements', 0, arguments.length]);\n }\n}\nDatasetController.defaults = {};\nDatasetController.prototype.datasetElementType = null;\nDatasetController.prototype.dataElementType = null;\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n }\n return scale._cache.$bar;\n}\nfunction computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = () => {\n if (curr === 32767 || curr === -32768) {\n return;\n }\n if (defined(prev)) {\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - (size / 2)\n };\n}\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) {\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n if (next === null) {\n next = curr + curr - prev;\n }\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {start, end, reverse, top, bottom};\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {top: true, right: true, bottom: true, left: true};\n return;\n }\n const {start, end, reverse, top, bottom} = borderProps(properties);\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n properties.inflateAmount = inflateAmount === 'auto'\n ? ratio === 1 ? 0.33 : 0\n : inflateAmount;\n}\nclass BarController extends DatasetController {\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {iScale, vScale} = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom)\n ? '[' + custom.start + ', ' + custom.end + ']'\n : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const {index, _cachedMeta: {vScale}} = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n for (let i = start; i < start + count; i++) {\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const {iScale} = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type)\n .filter(meta => meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta) => {\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n for (const meta of metasets) {\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n if (stacked === false || stacks.indexOf(meta.stack) === -1 ||\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n if (!stacks.length) {\n stacks.push(undefined);\n }\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = (name !== undefined)\n ? stacks.indexOf(name)\n : -1;\n return (index === -1)\n ? stacks.length - 1\n : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const {_cachedMeta: {vScale, _stacked}, options: {base: baseValue, minBarLength}} = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n head = base;\n }\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex'\n ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n : computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for (; i < ilen; ++i) {\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n}\nBarController.id = 'bar';\nBarController.defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'base', 'width', 'height']\n }\n }\n};\nBarController.overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true,\n }\n }\n};\n\nclass BubbleController extends DatasetController {\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: meta.label,\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n if (reset) {\n properties.options.radius = 0;\n }\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) {\n values = Object.assign({}, values, {$shared: false});\n }\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n return values;\n }\n}\nBubbleController.id = 'bubble';\nBubbleController.defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'borderWidth', 'radius']\n }\n }\n};\nBubbleController.overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n },\n plugins: {\n tooltip: {\n callbacks: {\n title() {\n return '';\n }\n }\n }\n }\n};\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {ratioX, ratioY, offsetX, offsetY};\n}\nclass DoughnutController extends DatasetController {\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i) => +data[i];\n if (isObject(data[start])) {\n const {key = 'value'} = this._parsing;\n getter = (i) => +resolveObjectKey(data[i], key);\n }\n let i, ilen;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n meta._parsed[i] = getter(i);\n }\n }\n }\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n return {\n rotation: min,\n circumference: max - min,\n };\n }\n update(mode) {\n const chart = this.chart;\n const {chartArea} = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const {circumference, rotation} = this._getRotationExtents();\n const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for (i = 0; i < start; ++i) {\n startAngle += this._circumference(i, reset);\n }\n for (i = start; i < start + count; ++i) {\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for (i = 0; i < metaData.length; i++) {\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || '',\n value,\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n if (!arcs) {\n return 0;\n }\n for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for (let i = 0; i < datasetIndex; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\nDoughnutController.id = 'doughnut';\nDoughnutController.defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n },\n },\n cutout: '50%',\n rotation: 0,\n circumference: 360,\n radius: '100%',\n spacing: 0,\n indexAxis: 'r',\n};\nDoughnutController.descriptors = {\n _scriptable: (name) => name !== 'spacing',\n _indexable: (name) => name !== 'spacing',\n};\nDoughnutController.overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle}} = chart.legend.options;\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n },\n tooltip: {\n callbacks: {\n title() {\n return '';\n },\n label(tooltipItem) {\n let dataLabel = tooltipItem.label;\n const value = ': ' + tooltipItem.formattedValue;\n if (isArray(dataLabel)) {\n dataLabel = dataLabel.slice();\n dataLabel[0] += value;\n } else {\n dataLabel += value;\n }\n return dataLabel;\n }\n }\n }\n }\n};\n\nclass LineController extends DatasetController {\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const {dataset: line, data: points = [], _dataset} = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\nLineController.id = 'line';\nLineController.defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n showLine: true,\n spanGaps: false,\n};\nLineController.overrides = {\n scales: {\n _index_: {\n type: 'category',\n },\n _value_: {\n type: 'linear',\n },\n }\n};\n\nclass PolarAreaController extends DatasetController {\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || '',\n value,\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n meta.data.forEach((element, index) => {\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - (radiusLength * this.index);\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for (i = 0; i < start; ++i) {\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for (i = start; i < start + count; i++) {\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index) => {\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index)\n ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n : 0;\n }\n}\nPolarAreaController.id = 'polarArea';\nPolarAreaController.defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n },\n },\n indexAxis: 'r',\n startAngle: 0,\n};\nPolarAreaController.overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle}} = chart.legend.options;\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n },\n tooltip: {\n callbacks: {\n title() {\n return '';\n },\n label(context) {\n return context.chart.data.labels[context.dataIndex] + ': ' + context.formattedValue;\n }\n }\n }\n },\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n};\n\nclass PieController extends DoughnutController {\n}\nPieController.id = 'pie';\nPieController.defaults = {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: '100%'\n};\n\nclass RadarController extends DatasetController {\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\nRadarController.id = 'radar';\nRadarController.defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n },\n};\nRadarController.overrides = {\n aspectRatio: 1,\n scales: {\n r: {\n type: 'radialLinear',\n }\n }\n};\n\nclass Element {\n constructor() {\n this.x = undefined;\n this.y = undefined;\n this.active = false;\n this.options = undefined;\n this.$animations = undefined;\n }\n tooltipPosition(useFinalPosition) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) {\n return this;\n }\n const ret = {};\n props.forEach(prop => {\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n}\nElement.defaults = {};\nElement.defaultRoutes = undefined;\n\nconst formatters = {\n values(value) {\n return isArray(value) ? value : '' + value;\n },\n numeric(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n delta = calculateDelta(tickValue, ticks);\n }\n const logDelta = log10(Math.abs(delta));\n const numDecimal = Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n Object.assign(options, this.options.ticks.format);\n return formatNumber(tickValue, locale, options);\n },\n logarithmic(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = tickValue / (Math.pow(10, Math.floor(log10(tickValue))));\n if (remain === 1 || remain === 2 || remain === 5) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n};\nfunction calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\nvar Ticks = {formatters};\n\ndefaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: 'ticks',\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawBorder: true,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options) => options.lineWidth,\n tickColor: (_ctx, options) => options.color,\n offset: false,\n borderDash: [],\n borderDashOffset: 0.0,\n borderWidth: 1\n },\n title: {\n display: false,\n text: '',\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2,\n }\n});\ndefaults.route('scale.ticks', 'color', '', 'color');\ndefaults.route('scale.grid', 'color', '', 'borderColor');\ndefaults.route('scale.grid', 'borderColor', '', 'borderColor');\ndefaults.route('scale.title', 'color', '', 'color');\ndefaults.describe('scale', {\n _fallback: false,\n _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash',\n});\ndefaults.describe('scales', {\n _fallback: 'scale',\n});\ndefaults.describe('scale.ticks', {\n _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name) => name !== 'backdropPadding',\n});\n\nfunction autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const ticksLimit = tickOpts.maxTicksLimit || determineMaxTicks(scale);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n const factors = _factorize(evenMajorSpacing);\n for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\nfunction getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for (i = 0; i < ticks.length; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while (next < 0) {\n count++;\n next = Math.round(start + count * spacing);\n }\n for (i = Math.max(start, 0); i < end; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\nfunction getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) {\n return false;\n }\n for (diff = arr[0], i = 1; i < len; ++i) {\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nfunction sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for (; i < len; i += increment) {\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\nfunction garbageCollect(caches, length) {\n each(caches, (cache) => {\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for (i = 0; i < gcLen; ++i) {\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\nfunction getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\nfunction getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n return (lines * font.lineHeight) + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\nfunction titleAlign(align, position, reverse) {\n let ret = _toLeftRightCenter(align);\n if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n ret = reverseAlign(ret);\n }\n return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n const {top, left, bottom, right, chart} = scale;\n const {chartArea, scales} = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {titleX, titleY, maxWidth, rotation};\n}\nclass Scale extends Element {\n constructor(cfg) {\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isNumberFinite(_userMin),\n maxDefined: isNumberFinite(_userMax)\n };\n }\n getMinMax(canStack) {\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) {\n return {min, max};\n }\n const metas = this.getMatchingVisibleMetas();\n for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n callback(this.options.beforeUpdate, [this]);\n }\n update(maxWidth, maxHeight, margins) {\n const {beginAtZero, grace, ticks: tickOpts} = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal()\n ? this.width + margins.left + margins.right\n : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) {\n this._convertTicksToLabels(this.ticks);\n }\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n callback(this.options.afterUpdate, [this]);\n }\n beforeSetDimensions() {\n callback(this.options.beforeSetDimensions, [this]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n callback(this.options.afterSetDimensions, [this]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n callback(this.options[name], [this]);\n }\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n beforeTickToLabelConversion() {\n callback(this.options.beforeTickToLabelConversion, [this]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n tick = ticks[i];\n tick.label = callback(tickOpts.callback, [tick.value, i, ticks], this);\n }\n }\n afterTickToLabelConversion() {\n callback(this.options.afterTickToLabelConversion, [this]);\n }\n beforeCalculateLabelRotation() {\n callback(this.options.beforeCalculateLabelRotation, [this]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = this.ticks.length;\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(\n Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n ));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n callback(this.options.afterCalculateLabelRotation, [this]);\n }\n afterAutoSkip() {}\n beforeFit() {\n callback(this.options.beforeFit, [this]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const {first, last, widest, highest} = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const {ticks: {align, padding}, position} = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n callback(this.options.afterFit, [this]);\n }\n isHorizontal() {\n const {axis, position} = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length) {\n const {ctx, _longestTextCache: caches} = this;\n const widths = [];\n const heights = [];\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for (i = 0; i < length; ++i) {\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n for (j = 0, jlen = label.length; j < jlen; ++j) {\n nestedLabel = label[j];\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights,\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const {min, max} = this;\n return min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal()\n ? h * cos > w * sin ? w / cos : h / sin\n : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== 'auto') {\n return !!display;\n }\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const {grid, position} = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n const borderOpts = grid.setContext(this.getContext());\n const axisWidth = borderOpts.drawBorder ? borderOpts.borderWidth : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for (i = 0; i < ticksLength; i += step) {\n const optsAtIndex = grid.setContext(this.getContext(i));\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndex.borderDash || [];\n const borderDashOffset = optsAtIndex.borderDashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) {\n continue;\n }\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset,\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const {position, ticks: optionTicks} = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const {align, crossAlign, padding, mirror} = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n const labelSizes = this._getLabelSizes();\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = y + textOffset - labelPadding.top;\n let left = x - labelPadding.left;\n switch (textBaseline) {\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n }\n switch (textAlign) {\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n }\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor,\n };\n }\n items.push({\n rotation,\n label,\n font,\n color,\n strokeColor,\n strokeWidth,\n textOffset,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [x, y],\n backdrop,\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const {position, ticks} = this.options;\n const rotation = -toRadians(this.labelRotation);\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n let align = 'center';\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += (widest / 2);\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n return {textAlign, x};\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n const chart = this.chart;\n const position = this.options.position;\n if (position === 'left' || position === 'right') {\n return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n } if (position === 'top' || position === 'bottom') {\n return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n }\n }\n drawBackground() {\n const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex(t => t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style) => {\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) {\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n if (grid.drawOnChartArea) {\n drawLine(\n {x: item.x1, y: item.y1},\n {x: item.x2, y: item.y2},\n item\n );\n }\n if (grid.drawTicks) {\n drawLine(\n {x: item.tx1, y: item.ty1},\n {x: item.tx2, y: item.ty2},\n {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n }\n );\n }\n }\n }\n }\n drawBorder() {\n const {chart, ctx, options: {grid}} = this;\n const borderOpts = grid.setContext(this.getContext());\n const axisWidth = grid.drawBorder ? borderOpts.borderWidth : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.borderWidth;\n ctx.strokeStyle = borderOpts.borderColor;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) {\n return;\n }\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n let i, ilen;\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n const tickFont = item.font;\n const label = item.label;\n if (item.backdrop) {\n ctx.fillStyle = item.backdrop.color;\n ctx.fillRect(item.backdrop.left, item.backdrop.top, item.backdrop.width, item.backdrop.height);\n }\n let y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, item);\n }\n if (area) {\n unclipArea(ctx);\n }\n }\n drawTitle() {\n const {ctx, options: {position, title, reverse}} = this;\n if (!title.display) {\n return;\n }\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n return [{\n z: tz,\n draw: (chartArea) => {\n this.draw(chartArea);\n }\n }];\n }\n return [{\n z: gz,\n draw: (chartArea) => {\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n }, {\n z: gz + 1,\n draw: () => {\n this.drawBorder();\n }\n }, {\n z: tz,\n draw: (chartArea) => {\n this.drawLabels(chartArea);\n }\n }];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n\nclass TypedRegistry {\n constructor(type, scope, override) {\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if (isIChartComponent(proto)) {\n parentScope = this.register(proto);\n }\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n if (id in items) {\n return scope;\n }\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) {\n delete items[id];\n }\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\nfunction registerDefaults(item, scope, parentScope) {\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n defaults.set(scope, itemDefaults);\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach(property => {\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [scope].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n constructor() {\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n this._typedRegistries = [this.controllers, this.scales, this.elements];\n }\n add(...args) {\n this._each('register', args);\n }\n remove(...args) {\n this._each('unregister', args);\n }\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [...args].forEach(arg => {\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n this._exec(method, reg, arg);\n } else {\n each(arg, item => {\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n callback(component['before' + camelMethod], [], component);\n registry[method](component);\n callback(component['after' + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for (let i = 0; i < this._typedRegistries.length; i++) {\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n}\nvar registry = new Registry();\n\nclass ScatterController extends DatasetController {\n update(mode) {\n const meta = this._cachedMeta;\n const {data: points = []} = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n const {dataset: line, _dataset} = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const {showLine} = this.options;\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = registry.getElement('line');\n }\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\nScatterController.id = 'scatter';\nScatterController.defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n};\nScatterController.overrides = {\n interaction: {\n mode: 'point'\n },\n plugins: {\n tooltip: {\n callbacks: {\n title() {\n return '';\n },\n label(item) {\n return '(' + item.label + ', ' + item.formattedValue + ')';\n }\n }\n }\n },\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n};\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPolarAreaController: PolarAreaController,\nPieController: PieController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\nfunction abstract() {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\nclass DateAdapter {\n constructor(options) {\n this.options = options || {};\n }\n init(chartOptions) {}\n formats() {\n return abstract();\n }\n parse(value, format) {\n return abstract();\n }\n format(timestamp, format) {\n return abstract();\n }\n add(timestamp, amount, unit) {\n return abstract();\n }\n diff(a, b, unit) {\n return abstract();\n }\n startOf(timestamp, unit, weekday) {\n return abstract();\n }\n endOf(timestamp, unit) {\n return abstract();\n }\n}\nDateAdapter.override = function(members) {\n Object.assign(DateAdapter.prototype, members);\n};\nvar adapters = {\n _date: DateAdapter\n};\n\nfunction binarySearch(metaset, axis, value, intersect) {\n const {controller, data, _sorted} = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {lo: start.lo, hi: end.hi};\n }\n }\n }\n return {lo: 0, hi: data.length - 1};\n}\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n const {index, data} = metasets[i];\n const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n for (let j = lo; j <= hi; ++j) {\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\nfunction getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n };\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({element, datasetIndex, index});\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [{element, datasetIndex, index}];\n minDistance = distance;\n } else if (distance === minDistance) {\n items.push({element, datasetIndex, index});\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n return axis === 'r' && !intersect\n ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({element, datasetIndex, index});\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\nvar Interaction = {\n evaluateInteractionItems,\n modes: {\n index(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) {\n return [];\n }\n chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) {\n elements.push({element, datasetIndex: meta.index, index});\n }\n });\n return elements;\n },\n dataset(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for (let i = 0; i < data.length; ++i) {\n items.push({element: data[i], datasetIndex, index: i});\n }\n }\n return items;\n },\n point(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n y(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\nfunction filterByPosition(array, position) {\n return array.filter(v => v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b) => {\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0.index - v1.index :\n v0.weight - v1.weight;\n });\n}\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n box = boxes[i];\n ({position: pos, options: {stack, stackWeight = 1}} = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && (pos + stack),\n stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts) {\n const {stack, pos, stackWeight} = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\nfunction setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const {vBoxMaxWidth, hBoxMaxHeight} = params;\n let i, ilen, layout;\n for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n layout = layouts[i];\n const {fullSize} = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n const {pos, box} = layout;\n const maxPadding = chartArea.maxPadding;\n if (!isObject(pos)) {\n if (layout.size) {\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {size: 0, count: 1};\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal\n ? {same: widthChanged, other: heightChanged}\n : {same: heightChanged, other: widthChanged};\n}\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {left: 0, top: 0, right: 0, bottom: 0};\n positions.forEach((pos) => {\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal\n ? marginForPositions(['left', 'right'])\n : marginForPositions(['top', 'bottom']);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n layout = boxes[i];\n box = layout.box;\n box.update(\n layout.width || chartArea.w,\n layout.height || chartArea.h,\n getMargins(layout.horizontal, chartArea)\n );\n const {same, other} = updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) {\n refitBoxes.push(layout);\n }\n }\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let {x, y} = chartArea;\n for (const layout of boxes) {\n const box = layout.box;\n const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n const weight = (layout.stackWeight / stack.weight) || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\ndefaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n});\nvar layouts = {\n addBox(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [{\n z: 0,\n draw(chartArea) {\n item.draw(chartArea);\n }\n }];\n };\n chart.boxes.push(item);\n },\n removeBox(chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n configure(chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update(chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n each(chart.boxes, box => {\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n handleMaxPadding(chartArea);\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w,\n };\n each(boxes.chartArea, (layout) => {\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n });\n }\n};\n\nclass BasePlatform {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {\n }\n}\n\nclass BasicPlatform extends BasePlatform {\n acquireContext(item) {\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n\nconst EXPANDO_KEY = '$chartjs';\nconst EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\nconst isNullOrEmpty = value => value === null || value === '';\nfunction initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || 'block';\n style.boxSizing = style.boxSizing || 'border-box';\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const {x, y} = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n}\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList) {\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart) => {\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height) => {\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n listener();\n }\n }, window);\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event) => {\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart, (args) => {\n const event = args[0];\n return [event, event.offsetX, event.offsetY];\n });\n addListener(canvas, type, proxy);\n return proxy;\n}\nclass DomPlatform extends BasePlatform {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n if (context && context.canvas === canvas) {\n initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n const initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach((prop) => {\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key) => {\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) {\n return;\n }\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n\nfunction _detectPlatform(canvas) {\n if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nclass PluginService {\n constructor() {\n this._init = [];\n }\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors) {\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [chart, args, descriptor.options];\n if (callback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n return true;\n }\n invalidate() {\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\nfunction allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for (let i = 0; i < keys.length; i++) {\n plugins.push(registry.getPlugin(keys[i]));\n }\n const local = config.plugins || [];\n for (let i = 0; i < local.length; i++) {\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {plugins, localIds};\n}\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\nfunction createDescriptors(chart, {plugins, localIds}, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins) {\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)\n });\n }\n return result;\n}\nfunction pluginOpts(config, {plugin, local}, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [''], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n\nfunction getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\nfunction determineAxis(id, scaleOptions) {\n if (id === 'x' || id === 'y') {\n return id;\n }\n return scaleOptions.axis || axisFromPosition(scaleOptions.position) || id.charAt(0).toLowerCase();\n}\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {scales: {}};\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const firstIDs = Object.create(null);\n const scales = Object.create(null);\n Object.keys(configScales).forEach(id => {\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n firstIDs[axis] = firstIDs[axis] || id;\n scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n });\n config.data.datasets.forEach(dataset => {\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach(defaultID => {\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || firstIDs[axis] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n });\n });\n Object.keys(scales).forEach(key => {\n const scale = scales[key];\n mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n });\n return scales;\n}\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n initOptions(config);\n return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\nconst addIfFound = (set, obj, key) => {\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\nclass Config {\n constructor(config) {\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType,\n () => [[\n `datasets.${datasetType}`,\n ''\n ]]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`,\n () => [\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`,\n () => [[\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`,\n () => [[\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const {options, type} = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n const scopes = new Set();\n keyLists.forEach(keys => {\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach(key => addIfFound(scopes, mainScope, key));\n }\n keys.forEach(key => addIfFound(scopes, options, key));\n keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach(key => addIfFound(scopes, defaults, key));\n keys.forEach(key => addIfFound(scopes, descriptors, key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n chartOptionScopes() {\n const {options, type} = this;\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {},\n {type},\n defaults,\n descriptors\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n const result = {$shared: true};\n const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n for (const prop of names) {\n result[prop] = options[prop];\n }\n return result;\n }\n createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context)\n ? _attachContext(resolver, context, undefined, descriptorDefaults)\n : resolver;\n }\n}\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst hasFunction = value => isObject(value)\n && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n const {isScriptable, isIndexable} = _descriptors(proxy);\n for (const prop of names) {\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if ((scriptable && (isFunction(value) || hasFunction(value)))\n || (indexable && isArray(value))) {\n return true;\n }\n }\n return false;\n}\n\nvar version = \"3.9.1\";\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1]\n ? a[l2] - b[l2]\n : a[l1] - b[l1];\n };\n}\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins('afterRender');\n callback(animationOptions && animationOptions.onComplete, [context], chart);\n}\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callback(animationOptions && animationOptions.onProgress, [context], chart);\n}\nfunction getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n item = item[0];\n }\n if (item && item.canvas) {\n item = item.canvas;\n }\n return item;\n}\nconst instances = {};\nconst getChart = (key) => {\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys) {\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\nclass Chart {\n constructor(item, userConfig) {\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error(\n 'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.'\n );\n }\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n get aspectRatio() {\n const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n if (!isNullOrUndef(aspectRatio)) {\n return aspectRatio;\n }\n if (maintainAspectRatio && _aspectRatio) {\n return _aspectRatio;\n }\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n _initialize() {\n this.notifyPlugins('beforeInit');\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n this.bindEvents();\n this.notifyPlugins('afterInit');\n return this;\n }\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n stop() {\n animator.stop(this);\n return this;\n }\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {width, height};\n }\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n this.notifyPlugins('resize', {size: newSize});\n callback(options.onResize, [this, newSize], this);\n if (this.attached) {\n if (this._doResize(mode)) {\n this.render();\n }\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n each(scalesOptions, (axisOptions, axisID) => {\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id) => {\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) {\n items = items.concat(\n Object.keys(scaleOpts).map((id) => {\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n })\n );\n }\n each(items, (item) => {\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n each(updated, (hasUpdated, id) => {\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n each(scales, (scale) => {\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b) => a.index - b.index);\n if (numMeta > numData) {\n for (let i = numData; i < numMeta; ++i) {\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n _removeUnreferencedMetasets() {\n const {_metasets: metasets, data: {datasets}} = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index) => {\n if (datasets.filter(x => x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for (i = 0, ilen = datasets.length; i < ilen; i++) {\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const {datasetElementType, dataElementType} = defaults.datasets[type];\n Object.assign(ControllerClass.prototype, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex) => {\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins('beforeElementsUpdate');\n let minPadding = 0;\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n const {controller} = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) {\n each(newControllers, (controller) => {\n controller.reset();\n });\n }\n this._updateDatasets(mode);\n this.notifyPlugins('afterUpdate', {mode});\n this._layers.sort(compare2Level('z', '_idx'));\n const {_active, _lastEvent} = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n this.render();\n }\n _updateScales() {\n each(this.scales, (scale) => {\n layouts.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const {_hiddenIndices} = this;\n const changes = this._getUniformDataChanges() || [];\n for (const {method, start, count} of changes) {\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx) => new Set(\n _dataChanges\n .filter(c => c[0] === idx)\n .map((c, i) => i + ',' + c.splice(1).join(','))\n );\n const changeSet = makeSet(0);\n for (let i = 1; i < datasetCount; i++) {\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet)\n .map(c => c.split(','))\n .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n return;\n }\n layouts.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n each(this.boxes, (box) => {\n if (noArea && box.position === 'chartArea') {\n return;\n }\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index) => {\n item._idx = index;\n });\n this.notifyPlugins('afterLayout');\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this.getDatasetMeta(i).controller.configure();\n }\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n }\n this.notifyPlugins('afterDatasetsUpdate', {mode});\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {meta, index, mode, cancelable: true};\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n render() {\n if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n return;\n }\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({chart: this});\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const {width, height} = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n return;\n }\n const layers = this._layers;\n for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n layers[i].draw(this.chartArea);\n }\n this._drawDatasets();\n for (; i < layers.length; ++i) {\n layers[i].draw(this.chartArea);\n }\n this.notifyPlugins('afterDraw');\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n return;\n }\n const metasets = this.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n this._drawDataset(metasets[i]);\n }\n this.notifyPlugins('afterDatasetsDraw');\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = this.chartArea;\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n meta.controller.draw();\n if (useClip) {\n unclipArea(ctx);\n }\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {visible});\n this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._destroyDatasetMeta(i);\n }\n }\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const {canvas, ctx} = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n this.notifyPlugins('destroy');\n delete instances[this.id];\n this.notifyPlugins('afterDestroy');\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y) => {\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n each(this.options.events, (type) => _add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener) => {\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height) => {\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n let detached;\n const attached = () => {\n _remove('attach', attached);\n this.attached = true;\n this.resize();\n _add('resize', listener);\n _add('detach', detached);\n };\n detached = () => {\n this.attached = false;\n _remove('resize', listener);\n this._stop();\n this._resize(0, 0);\n _add('attach', attached);\n };\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n unbindEvents() {\n each(this._listeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n each(this._responsiveListeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n if (changed || args.changed) {\n this.render();\n }\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const {_active: lastActive = [], options} = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n callback(options.onHover, [e, active, this], this);\n if (isClick) {\n callback(options.onClick, [e, active, this], this);\n }\n }\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\nconst invalidatePlugins = () => each(Chart.instances, (chart) => chart._plugins.invalidate());\nconst enumerable = true;\nObject.defineProperties(Chart, {\n defaults: {\n enumerable,\n value: defaults\n },\n instances: {\n enumerable,\n value: instances\n },\n overrides: {\n enumerable,\n value: overrides\n },\n registry: {\n enumerable,\n value: registry\n },\n version: {\n enumerable,\n value: version\n },\n getChart: {\n enumerable,\n value: getChart\n },\n register: {\n enumerable,\n value: (...items) => {\n registry.add(...items);\n invalidatePlugins();\n }\n },\n unregister: {\n enumerable,\n value: (...items) => {\n registry.remove(...items);\n invalidatePlugins();\n }\n }\n});\n\nfunction clipArc(ctx, element, endAngle) {\n const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n let angleMargin = pixelMargin / outerRadius;\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\nfunction parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n const computeOuterLimit = (val) => {\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n };\n}\nfunction rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta),\n };\n}\nfunction pathArc(ctx, element, offset, spacing, end, circular) {\n const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerEndAdjustedAngle);\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), startAngle + (innerStart / innerRadius), true);\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing, circular) {\n const {fullCircles, startAngle, circumference} = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, startAngle + TAU, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + circumference % TAU;\n if (circumference % TAU === 0) {\n endAngle += TAU;\n }\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction drawFullCircleBorders(ctx, element, inner) {\n const {x, y, startAngle, pixelMargin, fullCircles} = element;\n const outerRadius = Math.max(element.outerRadius - pixelMargin, 0);\n const innerRadius = element.innerRadius + pixelMargin;\n let i;\n if (inner) {\n clipArc(ctx, element, startAngle + TAU);\n }\n ctx.beginPath();\n ctx.arc(x, y, innerRadius, startAngle + TAU, startAngle, true);\n for (i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle, startAngle + TAU);\n for (i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n}\nfunction drawBorder(ctx, element, offset, spacing, endAngle, circular) {\n const {options} = element;\n const {borderWidth, borderJoinStyle} = options;\n const inner = options.borderAlign === 'inner';\n if (!borderWidth) {\n return;\n }\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n if (element.fullCircles) {\n drawFullCircleBorders(ctx, element, inner);\n }\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n}\nclass ArcElement extends Element {\n constructor(cfg) {\n super();\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps(['x', 'y'], useFinalPosition);\n const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = this.options.spacing / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return (betweenAngles && withinRadius);\n }\n getCenterPoint(useFinalPosition) {\n const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference',\n ], useFinalPosition);\n const {offset, spacing} = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const {options, circumference} = this;\n const offset = (options.offset || 0) / 2;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n ctx.save();\n let radiusOffset = 0;\n if (offset) {\n radiusOffset = offset / 2;\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * radiusOffset, Math.sin(halfAngle) * radiusOffset);\n if (this.circumference >= PI) {\n radiusOffset = offset;\n }\n }\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n const endAngle = drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, endAngle, circular);\n ctx.restore();\n }\n}\nArcElement.id = 'arc';\nArcElement.defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true,\n};\nArcElement.defaultRoutes = {\n backgroundColor: 'backgroundColor'\n};\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n const {start: segmentStart, end: segmentEnd} = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\nfunction pathSegment(ctx, line, segment, params) {\n const {points, options} = line;\n const {count, start, loop, ilen} = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n let {move = true, reverse} = params || {};\n let i, point, prev;\n for (i = 0; i <= ilen; ++i) {\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) {\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\nfunction fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const {count, start, ilen} = pathVars(points, segment, params);\n const {move = true, reverse} = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n const drawX = () => {\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for (i = 0; i <= ilen; ++i) {\n point = points[pointIndex(i)];\n if (point.skip) {\n continue;\n }\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\nfunction _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\nfunction _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n const {segments, options} = line;\n const segmentMethod = _getSegmentMethod(line);\n for (const segment of segments) {\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\nclass LineElement extends Element {\n constructor(cfg) {\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {property, start: value, end: value});\n if (!segments.length) {\n return;\n }\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for (i = 0, ilen = segments.length; i < ilen; ++i) {\n const {start, end} = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || (this.points.length - start);\n for (const segment of segments) {\n loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n }\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\nLineElement.id = 'line';\nLineElement.defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0,\n};\nLineElement.defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n};\nLineElement.descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n};\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const {[axis]: value} = el.getProps([axis], useFinalPosition);\n return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\nclass PointElement extends Element {\n constructor(cfg) {\n super();\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange$1(this, mouseX, 'x', useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange$1(this, mouseY, 'y', useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n return options.radius + options.hitRadius;\n }\n}\nPointElement.id = 'point';\nPointElement.defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n};\nPointElement.defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n};\n\nfunction getBarBounds(bar, useFinalPosition) {\n const {x, y, base, width, height} = bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {left, top, right, bottom};\n}\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || isObject(value);\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n }\n }\n };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\nfunction addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass BarElement extends Element {\n constructor(cfg) {\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n draw(ctx) {\n const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n const {inner, outer} = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const {x, y, base, horizontal} = this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\nBarElement.id = 'bar';\nBarElement.defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n};\nBarElement.defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n};\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nLineElement: LineElement,\nPointElement: PointElement,\nBarElement: BarElement\n});\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for (i = 0; i < samples - 2; i++) {\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for (j = avgRangeStart; j < avgRangeEnd; j++) {\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const {x: pointAx, y: pointAy} = data[a];\n maxArea = area = -1;\n for (j = rangeOffs; j < rangeTo; j++) {\n area = 0.5 * Math.abs(\n (pointAx - avgX) * (data[j].y - pointAy) -\n (pointAx - data[j].x) * (avgY - pointAy)\n );\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for (i = start; i < start + count; ++i) {\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX,\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n if (i > 0 && lastIndex !== startIndex) {\n decimated.push(data[lastIndex]);\n }\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {value: data});\n }\n}\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset) => {\n cleanDecimatedDataset(dataset);\n });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const {iScale} = meta;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n return {start, count};\n}\nvar plugin_decimation = {\n id: 'decimation',\n defaults: {\n algorithm: 'min-max',\n enabled: false,\n },\n beforeElementsUpdate: (chart, args, options) => {\n if (!options.enabled) {\n cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex) => {\n const {_data, indexAxis} = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n return;\n }\n if (!meta.controller.supportsDecimation) {\n return;\n }\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n return;\n }\n if (chart.options.parsing) {\n return;\n }\n let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n cleanDecimatedDataset(dataset);\n return;\n }\n if (isNullOrUndef(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch (options.algorithm) {\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy(chart) {\n cleanDecimatedData(chart);\n }\n};\n\nfunction _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments) {\n let {start, end} = segment;\n end = _findSegmentEnd(start, end, points);\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = _boundSegments(target, bounds);\n for (const tgt of targetSegments) {\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n for (const fillSource of fillSources) {\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {property, start, end};\n}\nfunction _pointsFromSegments(boundary, line) {\n const {x = null, y = null} = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({start, end}) => {\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({x: first.x, y});\n points.push({x: last.x, y});\n } else if (x !== null) {\n points.push({x, y: first.y});\n points.push({x, y: last.y});\n }\n });\n return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n for (;end > start; end--) {\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n\nfunction _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if (isArray(boundary)) {\n _loop = true;\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n return points.length ? new LineElement({\n points,\n options: {tension: 0},\n _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n\nfunction _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [index];\n let target;\n if (!propagate) {\n return fill;\n }\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isNumberFinite(fill)) {\n return fill;\n }\n target = sources[fill];\n if (!target) {\n return false;\n }\n if (target.visible) {\n return fill;\n }\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\nfunction _decodeFill(line, index, count) {\n const fill = parseFillOption(line);\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n let target = parseFloat(fill);\n if (isNumberFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n return target;\n}\nfunction _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\nfunction _getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\nfunction parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n if (fill === false || fill === null) {\n return false;\n }\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n\nfunction _buildStackLine(source) {\n const {scale, index, line} = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n for (let j = segment.start; j <= segment.end; j++) {\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({points, options: {}});\n}\nfunction getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n for (let i = 0; i < metas.length; i++) {\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for (let j = 0; j < linesBelow.length; j++) {\n const line = linesBelow[j];\n const {first, last, point} = findPoint(line, sourcePoint, 'x');\n if (!point || (first && last)) {\n continue;\n }\n if (first) {\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n break;\n }\n }\n }\n points.push(...postponed);\n}\nfunction findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {first, last, point};\n}\n\nclass simpleArc {\n constructor(opts) {\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n pathSegment(ctx, bounds, opts) {\n const {x, y, radius} = this;\n bounds = bounds || {start: 0, end: TAU};\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const {x, y, radius} = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n\nfunction _getTarget(source) {\n const {chart, fill, line} = source;\n if (isNumberFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n if (fill === 'shape') {\n return true;\n }\n const boundary = computeBoundary(source);\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n return _createBoundaryLine(boundary, line);\n}\nfunction getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n const {scale = {}, fill} = source;\n const pixel = _getTargetPixel(fill, scale);\n if (isNumberFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction computeCircularBoundary(source) {\n const {scale, fill} = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for (let i = 0; i < length; ++i) {\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\nfunction _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const {line, scale, axis} = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const {above = color, below = color} = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {line, target, above, below, area, scale, axis});\n unclipArea(ctx);\n }\n}\nfunction doFill(ctx, cfg) {\n const {line, target, above, below, area, scale} = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n ctx.save();\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {line, target, color: above, scale, property});\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {line, target, color: below, scale, property});\n ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n const {segments, points} = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments) {\n const {start, end} = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction fill(ctx, cfg) {\n const {line, target, property, color, scale} = cfg;\n const segments = _segments(line, target, property);\n for (const {source: src, target: tgt, start, end} of segments) {\n const {style: {backgroundColor = color} = {}} = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n ctx.restore();\n }\n}\nfunction clipBounds(ctx, scale, bounds) {\n const {top, bottom} = scale.chart.chartArea;\n const {property, start, end} = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\nvar index = {\n id: 'filler',\n afterDatasetsUpdate(chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line,\n };\n }\n meta.$filler = source;\n sources.push(source);\n }\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw(chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n beforeDatasetsDraw(chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n const metasets = chart.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n beforeDatasetDraw(chart, args, options) {\n const source = args.meta.$filler;\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n\nconst getBoxSize = (labelOpts, fontSize) => {\n let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n constructor(config) {\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = callback(labelOpts.generateLabels, [this.chart], this) || [];\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n }\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n }\n if (this.options.reverse) {\n legendItems.reverse();\n }\n this.legendItems = legendItems;\n }\n fit() {\n const {options, ctx} = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxWidth, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [0];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxHeight, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({width: currentColWidth, height: currentColHeight});\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({width: currentColWidth, height: currentColHeight});\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes) {\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes) {\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n this._draw();\n unclipArea(ctx);\n }\n }\n _draw() {\n const {options: opts, columnSizes, lineWidths, ctx} = this;\n const {align, labels: labelOpts} = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const {color: fontColor, padding} = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n ctx.save();\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some(v => v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n overrideTextDirection(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i) => {\n ctx.strokeStyle = legendItem.fontColor || fontColor;\n ctx.fillStyle = legendItem.fontColor || fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) {\n cursor.x += width + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n if (!titleOpts.display) {\n return;\n }\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = _alignStartEnd(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if (_isBetween(x, this.left, this.right)\n && _isBetween(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for (i = 0; i < lh.length; ++i) {\n hitBox = lh[i];\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n return this.legendItems[i];\n }\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n callback(opts.onLeave, [e, previous, this], this);\n }\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) {\n callback(opts.onHover, [e, hoveredItem, this], this);\n }\n } else if (hoveredItem) {\n callback(opts.onClick, [e, hoveredItem, this], this);\n }\n }\n}\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\nvar plugin_legend = {\n id: 'legend',\n _element: Legend,\n start(chart, _args, options) {\n const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n stop(chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate(chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate(chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent(chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick(e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx) => ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels(chart) {\n const datasets = chart.data.datasets;\n const {labels: {usePointStyle, pointStyle, textAlign, color}} = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta) => {\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: 0,\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx) => ctx.chart.options.color,\n display: false,\n position: 'center',\n text: '',\n }\n },\n descriptors: {\n _scriptable: (name) => !name.startsWith('on'),\n labels: {\n _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n }\n },\n};\n\nclass Title extends Element {\n constructor(config) {\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n _drawArgs(offset) {\n const {top, left, bottom, right, options} = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {titleX, titleY, maxWidth, rotation};\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) {\n return;\n }\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n}\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar plugin_title = {\n id: 'title',\n _element: Title,\n start(chart, _args, options) {\n createTitle(chart, options);\n },\n stop(chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate(chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold',\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n id: 'subtitle',\n start(chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n stop(chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n beforeUpdate(chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal',\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n\nconst positioners = {\n average(items) {\n if (!items.length) {\n return false;\n }\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest(items, eventPosition) {\n if (!items.length) {\n return false;\n }\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x,\n y\n };\n }\n};\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n}\nfunction splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\nfunction createTooltipItem(chart, item) {\n const {element, datasetIndex, index} = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const {label, value} = controller.getLabelAndValue(index);\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\nfunction getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const {body, footer, title} = tooltip;\n const {boxWidth, boxHeight} = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n }\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n each(body, (bodyItem) => {\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {width, height};\n}\nfunction determineYAlign(chart, size) {\n const {y, height} = size;\n if (y < height / 2) {\n return 'top';\n } else if (y > (chart.height - height / 2)) {\n return 'bottom';\n }\n return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const {x, width} = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n const {x, width} = size;\n const {width: chartWidth, chartArea: {left, right}} = chart;\n let xAlign = 'center';\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n return xAlign;\n}\nfunction determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\nfunction alignX(size, xAlign) {\n let {x, width} = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= (width / 2);\n }\n return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n let {y, height} = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= (height / 2);\n }\n return y;\n}\nfunction getBackgroundPoint(options, size, alignment, chart) {\n const {caretSize, caretPadding, cornerRadius} = options;\n const {xAlign, yAlign} = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n return align === 'center'\n ? tooltip.x + tooltip.width / 2\n : align === 'right'\n ? tooltip.x + tooltip.width - padding.right\n : tooltip.x + padding.left;\n}\nfunction getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nclass Tooltip extends Element {\n constructor(config) {\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart || config._chart;\n this._chart = this.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) {\n return cached;\n }\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n return animations;\n }\n getContext() {\n return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const {callbacks} = options;\n const beforeTitle = callbacks.beforeTitle.apply(this, [context]);\n const title = callbacks.title.apply(this, [context]);\n const afterTitle = callbacks.afterTitle.apply(this, [context]);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this, [tooltipItems]));\n }\n getBody(tooltipItems, options) {\n const {callbacks} = options;\n const bodyItems = [];\n each(tooltipItems, (context) => {\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(scoped.beforeLabel.call(this, context)));\n pushOrConcat(bodyItem.lines, scoped.label.call(this, context));\n pushOrConcat(bodyItem.after, splitNewlines(scoped.afterLabel.call(this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this, [tooltipItems]));\n }\n getFooter(tooltipItems, options) {\n const {callbacks} = options;\n const beforeFooter = callbacks.beforeFooter.apply(this, [tooltipItems]);\n const footer = callbacks.footer.apply(this, [tooltipItems]);\n const afterFooter = callbacks.afterFooter.apply(this, [tooltipItems]);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n }\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n }\n each(tooltipItems, (context) => {\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(scoped.labelColor.call(this, context));\n labelPointStyles.push(scoped.labelPointStyle.call(this, context));\n labelTextColors.push(scoped.labelTextColor.call(this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n if (changed && options.external) {\n options.external.call(this, {chart: this.chart, tooltip: this, replay});\n }\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const {xAlign, yAlign} = this;\n const {caretSize, cornerRadius} = options;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n const {x: ptX, y: ptY} = tooltipPoint;\n const {width, height} = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {x1, x2, x3, y1, y2, y3};\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for (i = 0; i < length; ++i) {\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColors = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const {boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColors.borderColor;\n ctx.fillStyle = labelColors.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = isObject(labelColors.borderWidth) ? Math.max(...Object.values(labelColors.borderWidth)) : (labelColors.borderWidth || 1);\n ctx.strokeStyle = labelColors.borderColor;\n ctx.setLineDash(labelColors.borderDash || []);\n ctx.lineDashOffset = labelColors.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth - boxPadding);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - boxPadding - 2);\n const borderRadius = toTRBLCorners(labelColors.borderRadius);\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColors.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColors.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const {body} = this;\n const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n : 0;\n for (i = 0, ilen = body.length; i < ilen; ++i) {\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for (j = 0, jlen = lines.length; j < jlen; ++j) {\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n each(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n footerFont = toFont(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for (i = 0; i < length; ++i) {\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const {xAlign, yAlign} = this;\n const {x, y} = pt;\n const {width, height} = tooltipSize;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) {\n return;\n }\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = toPadding(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n overrideTextDirection(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n restoreTextDirection(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) {\n active.reverse();\n }\n return active;\n }\n _positionChanged(active, e) {\n const {caretX, caretY, options} = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\nTooltip.positioners = positioners;\nvar plugin_tooltip = {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n afterInit(chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({chart, options});\n }\n },\n beforeUpdate(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n reset(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n afterDraw(chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n if (chart.notifyPlugins('beforeTooltipDraw', args) === false) {\n return;\n }\n tooltip.draw(chart.ctx);\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n afterEvent(chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n args.changed = true;\n }\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold',\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {\n },\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold',\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts) => opts.bodyFont.size,\n boxWidth: (ctx, opts) => opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart',\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: {\n beforeTitle: noop,\n title(tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n return '';\n },\n afterTitle: noop,\n beforeBody: noop,\n beforeLabel: noop,\n label(tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n let label = tooltipItem.dataset.label || '';\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0,\n };\n },\n labelTextColor() {\n return this.options.bodyColor;\n },\n labelPointStyle(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation,\n };\n },\n afterLabel: noop,\n afterBody: noop,\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n }\n },\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n descriptors: {\n _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false,\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n additionalOptionScopes: ['interaction']\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nDecimation: plugin_decimation,\nFiller: index,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({index, label: raw});\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\nclass CategoryScale extends Scale {\n constructor(cfg) {\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const {index, label} of added) {\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index\n : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this.getMinMax(true);\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for (let value = min; value <= max; value++) {\n ticks.push({value});\n }\n return ticks;\n }\n getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) {\n this._reversePixels = !this._reversePixels;\n }\n }\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n}\nCategoryScale.id = 'category';\nCategoryScale.defaults = {\n ticks: {\n callback: CategoryScale.prototype.getLabelForValue\n }\n};\n\nfunction generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const {min: rmin, max: rmax} = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [{value: rmin}, {value: rmax}];\n }\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n if (!isNullOrUndef(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n const decimalPlaces = Math.max(\n _decimalPlaces(spacing),\n _decimalPlaces(niceMin)\n );\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({value: min});\n if (niceMin < min) {\n j++;\n }\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n for (; j < numSpaces; ++j) {\n ticks.push({value: Math.round((niceMin + j * spacing) * factor) / factor});\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({value: max});\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({value: niceMax});\n }\n return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n constructor(cfg) {\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n return +raw;\n }\n handleTickRangeOptions() {\n const {beginAtZero} = this.options;\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this;\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n if (min === max) {\n let offset = 1;\n if (max >= Number.MAX_SAFE_INTEGER || min <= Number.MIN_SAFE_INTEGER) {\n offset = Math.abs(max * 0.05);\n }\n setMax(max + offset);\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let {maxTicksLimit, stepSize} = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n\nclass LinearScale extends LinearScaleBase {\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n this.min = isNumberFinite(min) ? min : 0;\n this.max = isNumberFinite(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\nLinearScale.id = 'linear';\nLinearScale.defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n};\n\nfunction isMajor(tickVal) {\n const remain = tickVal / (Math.pow(10, Math.floor(log10(tickVal))));\n return remain === 1;\n}\nfunction generateTicks(generationOptions, dataRange) {\n const endExp = Math.floor(log10(dataRange.max));\n const endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));\n const ticks = [];\n let tickVal = finiteOrDefault(generationOptions.min, Math.pow(10, Math.floor(log10(dataRange.min))));\n let exp = Math.floor(log10(tickVal));\n let significand = Math.floor(tickVal / Math.pow(10, exp));\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n do {\n ticks.push({value: tickVal, major: isMajor(tickVal)});\n ++significand;\n if (significand === 10) {\n significand = 1;\n ++exp;\n precision = exp >= 0 ? 1 : precision;\n }\n tickVal = Math.round(significand * Math.pow(10, exp) * precision) / precision;\n } while (exp < endExp || (exp === endExp && significand < endSignificand));\n const lastTick = finiteOrDefault(generationOptions.max, tickVal);\n ticks.push({value: lastTick, major: isMajor(tickVal)});\n return ticks;\n}\nclass LogarithmicScale extends Scale {\n constructor(cfg) {\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isNumberFinite(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n const exp = (v, m) => Math.pow(10, Math.floor(log10(v)) + m);\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin(exp(min, -1));\n setMax(exp(max, +1));\n }\n }\n if (min <= 0) {\n setMin(exp(max, -1));\n }\n if (max <= 0) {\n setMax(exp(min, +1));\n }\n if (this._zero && this.min !== this._suggestedMin && min === exp(this.min, 0)) {\n setMin(exp(min, -1));\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined\n ? '0'\n : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min\n ? 0\n : (log10(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\nLogarithmicScale.id = 'logarithmic';\nLogarithmicScale.defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n};\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [label];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n return {\n start: pos,\n end: pos + size\n };\n}\nfunction fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n for (let i = 0; i < valueCount; i++) {\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(\n orig.l - limits.l,\n limits.r - orig.r,\n orig.t - limits.t,\n limits.b - orig.b\n );\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const extra = getTickBackdropHeight(opts) / 2;\n const outerDistance = scale.drawingArea;\n const additionalAngle = opts.pointLabels.centerPointLabels ? PI / valueCount : 0;\n for (let i = 0; i < valueCount; i++) {\n const pointLabelPosition = scale.getPointPosition(i, outerDistance + extra + padding[i], additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const size = labelSizes[i];\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n items.push({\n x: pointLabelPosition.x,\n y,\n textAlign,\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n });\n }\n return items;\n}\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= (w / 2);\n }\n return x;\n}\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= (h / 2);\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\nfunction drawPointLabels(scale, labelCount) {\n const {ctx, options: {pointLabels}} = scale;\n for (let i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n const plFont = toFont(optsAtIndex.font);\n const {x, y, textAlign, left, top, right, bottom} = scale._pointLabelItems[i];\n const {backdropColor} = optsAtIndex;\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(optsAtIndex.borderRadius);\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n renderText(\n ctx,\n scale._pointLabels[i],\n x,\n y + (plFont.lineHeight / 2),\n plFont,\n {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n }\n );\n }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const {ctx} = scale;\n if (circular) {\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for (let i = 1; i < labelCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const {color, lineWidth} = gridLineOpts;\n if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n return;\n }\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(gridLineOpts.borderDash);\n ctx.lineDashOffset = gridLineOpts.borderDashOffset;\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\nclass RadialLinearScale extends LinearScaleBase {\n constructor(cfg) {\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n setDimensions() {\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const {min, max} = this.getMinMax(false);\n this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels()\n .map((value, index) => {\n const label = callback(this.options.pointLabels.callback, [value, index], this);\n return label || label === 0 ? label : '';\n })\n .filter((v, i) => this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const {left, top, right, bottom} = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom,\n };\n }\n drawBackground() {\n const {backgroundColor, grid: {circular}} = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const {angleLines, grid} = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n if (grid.display) {\n this.ticks.forEach((tick, index) => {\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const optsAtIndex = grid.setContext(this.getContext(index - 1));\n drawRadiusLine(this, optsAtIndex, offset, labelCount);\n }\n });\n }\n if (angleLines.display) {\n ctx.save();\n for (i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const {color, lineWidth} = optsAtIndex;\n if (!lineWidth || !color) {\n continue;\n }\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) {\n return;\n }\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n this.ticks.forEach((tick, index) => {\n if (index === 0 && !opts.reverse) {\n return;\n }\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(\n -width / 2 - padding.left,\n -offset - tickFont.size / 2 - padding.top,\n width + padding.width,\n tickFont.size + padding.height\n );\n }\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n}\nRadialLinearScale.id = 'radialLinear';\nRadialLinearScale.defaults = {\n display: true,\n animate: true,\n position: 'chartArea',\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: Ticks.formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback(label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n};\nRadialLinearScale.defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n};\nRadialLinearScale.descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n};\n\nconst INTERVALS = {\n millisecond: {common: true, size: 1, steps: 1000},\n second: {common: true, size: 1000, steps: 60},\n minute: {common: true, size: 60000, steps: 60},\n hour: {common: true, size: 3600000, steps: 24},\n day: {common: true, size: 86400000, steps: 30},\n week: {common: false, size: 604800000, steps: 4},\n month: {common: true, size: 2.628e9, steps: 12},\n quarter: {common: false, size: 7.884e9, steps: 4},\n year: {common: true, size: 3.154e10}\n};\nconst UNITS = (Object.keys(INTERVALS));\nfunction sorter(a, b) {\n return a - b;\n}\nfunction parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n const adapter = scale._adapter;\n const {parser, round, isoWeekday} = scale._parseOpts;\n let value = input;\n if (typeof parser === 'function') {\n value = parser(value);\n }\n if (!isNumberFinite(value)) {\n value = typeof parser === 'string'\n ? adapter.parse(value, parser)\n : adapter.parse(value);\n }\n if (value === null) {\n return null;\n }\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n ? adapter.startOf(value, 'isoWeek', isoWeekday)\n : adapter.startOf(value, round);\n }\n return +value;\n}\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n return UNITS[ilen - 1];\n}\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\nfunction determineMajorUnit(unit) {\n for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\nfunction addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const {lo, hi} = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for (i = 0; i < ilen; ++i) {\n value = values[i];\n map[value] = i;\n ticks.push({\n value,\n major: false\n });\n }\n return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n constructor(props) {\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = 'day';\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n init(scaleOpts, opts) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n adapter.init(opts);\n mergeIf(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {min, max};\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = _filterBetween(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip\n ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) {\n ticks.reverse();\n }\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map(tick => +tick.value));\n }\n }\n initOffsets(timestamps) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(timeOpts.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n addTick(ticks, time, timestamps);\n }\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n return Object.keys(ticks).sort((a, b) => a - b).map(x => +x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n const label = this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n const formatter = options.ticks.callback;\n return formatter ? callback(formatter, [label, index, ticks], this) : label;\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) {\n return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n }\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n return (this._cache.data = this.normalize(timestamps));\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const labels = this.getLabels();\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n timestamps.push(parse(this, labels[i]));\n }\n return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n }\n normalize(values) {\n return _arrayUnique(values.sort(sorter));\n }\n}\nTimeScale.id = 'time';\nTimeScale.defaults = {\n bounds: 'data',\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n source: 'auto',\n major: {\n enabled: false\n }\n }\n};\n\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({lo, hi} = _lookupByKey(table, 'pos', val));\n }\n ({pos: prevSource, time: prevTarget} = table[lo]);\n ({pos: nextSource, time: nextTarget} = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({lo, hi} = _lookupByKey(table, 'time', val));\n }\n ({time: prevSource, pos: prevTarget} = table[lo]);\n ({time: nextSource, pos: nextTarget} = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n constructor(props) {\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const {min, max} = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n if (items.length < 2) {\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n return table;\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) {\n return timestamps;\n }\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\nTimeSeriesScale.id = 'timeseries';\nTimeSeriesScale.defaults = TimeScale.defaults;\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale\n});\n\nconst registerables = [\n controllers,\n elements,\n plugins,\n scales,\n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, elements, layouts, plugins, registerables, registry, scales };\n", "export function divmod(value, lambda) {\n if (lambda === 0) throw new Error('Cannot divide by zero.')\n\n return [Math.floor(Math.abs(value) / lambda), Math.abs(value) % lambda]\n}\n", "import { divmod } from './math-utils'\n\nexport function toStonesAndPounds(value) {\n const negative = value < 0\n const correctValue = Math.abs(parseFloat(`${value}`))\n\n const [stones, pounds] = divmod(correctValue, 14)\n\n const weight =\n stones < 1\n ? `${parseFloat(pounds.toFixed(1))} lbs`\n : `${stones} st ${parseFloat(pounds.toFixed(1))} lbs`\n\n return negative ? `-${weight}` : weight\n}\n", "import { Controller } from '@hotwired/stimulus'\n// import Chartkick from 'chartkick'\nimport {\n Chart,\n LineController,\n Tooltip,\n Legend,\n CategoryScale,\n LinearScale,\n PointElement,\n LineElement,\n} from 'chart.js'\nimport { toStonesAndPounds } from '../utils/weight-utils'\n\nChart.register(\n LineController,\n Tooltip,\n Legend,\n CategoryScale,\n LinearScale,\n PointElement,\n LineElement\n)\n\nfunction getLabels(weekData) {\n return Object.keys(weekData).reverse()\n}\n\nexport default class extends Controller {\n static targets = ['chart']\n static values = {\n data: Object,\n }\n\n connect() {\n if (!this.hasChartTarget) return\n\n // const [theme] = useTheme()\n // const textColour = theme === 'dark' ? '#fff' : '#333'\n // const borderColour =\n // theme === 'dark' ? tailwindColours.gray[900] : tailwindColours.gray[100]\n // \"100\": \"#f5f5f5\"\n const borderColour = '#171717'\n const textColour = '#333'\n const computedStyle = getComputedStyle(document.body)\n\n const data = this.dataValue\n new Chart(this.chartTarget, {\n type: 'line',\n borderColor: borderColour,\n responsive: true,\n options: {\n datasets: {\n line: {\n spanGaps: true,\n },\n },\n plugins: {\n legend: {\n display: false,\n position: 'bottom',\n labels: {\n color: textColour,\n },\n },\n tooltip: {\n callbacks: {\n label: ({ raw }) => {\n return toStonesAndPounds(raw)\n },\n },\n },\n },\n scales: {\n y: {\n ticks: {\n // stepSize: 7,\n stepSize: 14,\n callback: value => {\n return toStonesAndPounds(value)\n },\n },\n },\n },\n },\n data: {\n labels: getLabels(data),\n datasets: [\n {\n // backgroundColor: GRAPH_COLOURS,\n label: 'Weight history',\n data: Object.values(data).reverse(),\n borderColor: computedStyle.getPropertyValue('--color-primary-400'),\n backgroundColor: computedStyle.getPropertyValue(\n '--color-primary-500'\n ),\n },\n ],\n },\n })\n }\n}\n", "import { Controller as s } from \"@hotwired/stimulus\";\nconst c = class c extends s {\n initialize() {\n this.toggle = this.toggle.bind(this), this.refresh = this.refresh.bind(this);\n }\n checkboxAllTargetConnected(e) {\n e.addEventListener(\"change\", this.toggle), this.refresh();\n }\n checkboxTargetConnected(e) {\n e.addEventListener(\"change\", this.refresh), this.refresh();\n }\n checkboxAllTargetDisconnected(e) {\n e.removeEventListener(\"change\", this.toggle), this.refresh();\n }\n checkboxTargetDisconnected(e) {\n e.removeEventListener(\"change\", this.refresh), this.refresh();\n }\n toggle(e) {\n e.preventDefault(), this.checkboxTargets.forEach((t) => {\n t.checked = e.target.checked, this.triggerInputEvent(t);\n });\n }\n refresh() {\n const e = this.checkboxTargets.length, t = this.checked.length;\n this.checkboxAllTarget.checked = t > 0, this.checkboxAllTarget.indeterminate = t > 0 && t < e;\n }\n triggerInputEvent(e) {\n const t = new Event(\"input\", { bubbles: !1, cancelable: !0 });\n e.dispatchEvent(t);\n }\n get checked() {\n return this.checkboxTargets.filter((e) => e.checked);\n }\n get unchecked() {\n return this.checkboxTargets.filter((e) => !e.checked);\n }\n};\nc.targets = [\"checkboxAll\", \"checkbox\"];\nlet h = c;\nexport {\n h as default\n};\n", "export var HOOKS = [\n \"onChange\",\n \"onClose\",\n \"onDayCreate\",\n \"onDestroy\",\n \"onKeyDown\",\n \"onMonthChange\",\n \"onOpen\",\n \"onParseConfig\",\n \"onReady\",\n \"onValueUpdate\",\n \"onYearChange\",\n \"onPreCalendarPosition\",\n];\nexport var defaults = {\n _disable: [],\n allowInput: false,\n allowInvalidPreload: false,\n altFormat: \"F j, Y\",\n altInput: false,\n altInputClass: \"form-control input\",\n animate: typeof window === \"object\" &&\n window.navigator.userAgent.indexOf(\"MSIE\") === -1,\n ariaDateFormat: \"F j, Y\",\n autoFillDefaultTime: true,\n clickOpens: true,\n closeOnSelect: true,\n conjunction: \", \",\n dateFormat: \"Y-m-d\",\n defaultHour: 12,\n defaultMinute: 0,\n defaultSeconds: 0,\n disable: [],\n disableMobile: false,\n enableSeconds: false,\n enableTime: false,\n errorHandler: function (err) {\n return typeof console !== \"undefined\" && console.warn(err);\n },\n getWeek: function (givenDate) {\n var date = new Date(givenDate.getTime());\n date.setHours(0, 0, 0, 0);\n date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));\n var week1 = new Date(date.getFullYear(), 0, 4);\n return (1 +\n Math.round(((date.getTime() - week1.getTime()) / 86400000 -\n 3 +\n ((week1.getDay() + 6) % 7)) /\n 7));\n },\n hourIncrement: 1,\n ignoredFocusElements: [],\n inline: false,\n locale: \"default\",\n minuteIncrement: 5,\n mode: \"single\",\n monthSelectorType: \"dropdown\",\n nextArrow: \"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>\",\n noCalendar: false,\n now: new Date(),\n onChange: [],\n onClose: [],\n onDayCreate: [],\n onDestroy: [],\n onKeyDown: [],\n onMonthChange: [],\n onOpen: [],\n onParseConfig: [],\n onReady: [],\n onValueUpdate: [],\n onYearChange: [],\n onPreCalendarPosition: [],\n plugins: [],\n position: \"auto\",\n positionElement: undefined,\n prevArrow: \"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>\",\n shorthandCurrentMonth: false,\n showMonths: 1,\n static: false,\n time_24hr: false,\n weekNumbers: false,\n wrap: false,\n};\n", "export var english = {\n weekdays: {\n shorthand: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n longhand: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n },\n months: {\n shorthand: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n longhand: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n },\n daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n firstDayOfWeek: 0,\n ordinal: function (nth) {\n var s = nth % 100;\n if (s > 3 && s < 21)\n return \"th\";\n switch (s % 10) {\n case 1:\n return \"st\";\n case 2:\n return \"nd\";\n case 3:\n return \"rd\";\n default:\n return \"th\";\n }\n },\n rangeSeparator: \" to \",\n weekAbbreviation: \"Wk\",\n scrollTitle: \"Scroll to increment\",\n toggleTitle: \"Click to toggle\",\n amPM: [\"AM\", \"PM\"],\n yearAriaLabel: \"Year\",\n monthAriaLabel: \"Month\",\n hourAriaLabel: \"Hour\",\n minuteAriaLabel: \"Minute\",\n time_24hr: false,\n};\nexport default english;\n", "export var pad = function (number, length) {\n if (length === void 0) { length = 2; }\n return (\"000\" + number).slice(length * -1);\n};\nexport var int = function (bool) { return (bool === true ? 1 : 0); };\nexport function debounce(fn, wait) {\n var t;\n return function () {\n var _this = this;\n var args = arguments;\n clearTimeout(t);\n t = setTimeout(function () { return fn.apply(_this, args); }, wait);\n };\n}\nexport var arrayify = function (obj) {\n return obj instanceof Array ? obj : [obj];\n};\n", "export function toggleClass(elem, className, bool) {\n if (bool === true)\n return elem.classList.add(className);\n elem.classList.remove(className);\n}\nexport function createElement(tag, className, content) {\n var e = window.document.createElement(tag);\n className = className || \"\";\n content = content || \"\";\n e.className = className;\n if (content !== undefined)\n e.textContent = content;\n return e;\n}\nexport function clearNode(node) {\n while (node.firstChild)\n node.removeChild(node.firstChild);\n}\nexport function findParent(node, condition) {\n if (condition(node))\n return node;\n else if (node.parentNode)\n return findParent(node.parentNode, condition);\n return undefined;\n}\nexport function createNumberInput(inputClassName, opts) {\n var wrapper = createElement(\"div\", \"numInputWrapper\"), numInput = createElement(\"input\", \"numInput \" + inputClassName), arrowUp = createElement(\"span\", \"arrowUp\"), arrowDown = createElement(\"span\", \"arrowDown\");\n if (navigator.userAgent.indexOf(\"MSIE 9.0\") === -1) {\n numInput.type = \"number\";\n }\n else {\n numInput.type = \"text\";\n numInput.pattern = \"\\\\d*\";\n }\n if (opts !== undefined)\n for (var key in opts)\n numInput.setAttribute(key, opts[key]);\n wrapper.appendChild(numInput);\n wrapper.appendChild(arrowUp);\n wrapper.appendChild(arrowDown);\n return wrapper;\n}\nexport function getEventTarget(event) {\n try {\n if (typeof event.composedPath === \"function\") {\n var path = event.composedPath();\n return path[0];\n }\n return event.target;\n }\n catch (error) {\n return event.target;\n }\n}\n", "import { int, pad } from \"../utils\";\nvar doNothing = function () { return undefined; };\nexport var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? \"shorthand\" : \"longhand\"][monthNumber]; };\nexport var revFormat = {\n D: doNothing,\n F: function (dateObj, monthName, locale) {\n dateObj.setMonth(locale.months.longhand.indexOf(monthName));\n },\n G: function (dateObj, hour) {\n dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));\n },\n H: function (dateObj, hour) {\n dateObj.setHours(parseFloat(hour));\n },\n J: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n K: function (dateObj, amPM, locale) {\n dateObj.setHours((dateObj.getHours() % 12) +\n 12 * int(new RegExp(locale.amPM[1], \"i\").test(amPM)));\n },\n M: function (dateObj, shortMonth, locale) {\n dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));\n },\n S: function (dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); },\n W: function (dateObj, weekNum, locale) {\n var weekNumber = parseInt(weekNum);\n var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);\n date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek);\n return date;\n },\n Y: function (dateObj, year) {\n dateObj.setFullYear(parseFloat(year));\n },\n Z: function (_, ISODate) { return new Date(ISODate); },\n d: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n h: function (dateObj, hour) {\n dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));\n },\n i: function (dateObj, minutes) {\n dateObj.setMinutes(parseFloat(minutes));\n },\n j: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n l: doNothing,\n m: function (dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n n: function (dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n s: function (dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n u: function (_, unixMillSeconds) {\n return new Date(parseFloat(unixMillSeconds));\n },\n w: doNothing,\n y: function (dateObj, year) {\n dateObj.setFullYear(2000 + parseFloat(year));\n },\n};\nexport var tokenRegex = {\n D: \"\",\n F: \"\",\n G: \"(\\\\d\\\\d|\\\\d)\",\n H: \"(\\\\d\\\\d|\\\\d)\",\n J: \"(\\\\d\\\\d|\\\\d)\\\\w+\",\n K: \"\",\n M: \"\",\n S: \"(\\\\d\\\\d|\\\\d)\",\n U: \"(.+)\",\n W: \"(\\\\d\\\\d|\\\\d)\",\n Y: \"(\\\\d{4})\",\n Z: \"(.+)\",\n d: \"(\\\\d\\\\d|\\\\d)\",\n h: \"(\\\\d\\\\d|\\\\d)\",\n i: \"(\\\\d\\\\d|\\\\d)\",\n j: \"(\\\\d\\\\d|\\\\d)\",\n l: \"\",\n m: \"(\\\\d\\\\d|\\\\d)\",\n n: \"(\\\\d\\\\d|\\\\d)\",\n s: \"(\\\\d\\\\d|\\\\d)\",\n u: \"(.+)\",\n w: \"(\\\\d\\\\d|\\\\d)\",\n y: \"(\\\\d{2})\",\n};\nexport var formats = {\n Z: function (date) { return date.toISOString(); },\n D: function (date, locale, options) {\n return locale.weekdays.shorthand[formats.w(date, locale, options)];\n },\n F: function (date, locale, options) {\n return monthToStr(formats.n(date, locale, options) - 1, false, locale);\n },\n G: function (date, locale, options) {\n return pad(formats.h(date, locale, options));\n },\n H: function (date) { return pad(date.getHours()); },\n J: function (date, locale) {\n return locale.ordinal !== undefined\n ? date.getDate() + locale.ordinal(date.getDate())\n : date.getDate();\n },\n K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; },\n M: function (date, locale) {\n return monthToStr(date.getMonth(), true, locale);\n },\n S: function (date) { return pad(date.getSeconds()); },\n U: function (date) { return date.getTime() / 1000; },\n W: function (date, _, options) {\n return options.getWeek(date);\n },\n Y: function (date) { return pad(date.getFullYear(), 4); },\n d: function (date) { return pad(date.getDate()); },\n h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); },\n i: function (date) { return pad(date.getMinutes()); },\n j: function (date) { return date.getDate(); },\n l: function (date, locale) {\n return locale.weekdays.longhand[date.getDay()];\n },\n m: function (date) { return pad(date.getMonth() + 1); },\n n: function (date) { return date.getMonth() + 1; },\n s: function (date) { return date.getSeconds(); },\n u: function (date) { return date.getTime(); },\n w: function (date) { return date.getDay(); },\n y: function (date) { return String(date.getFullYear()).substring(2); },\n};\n", "import { tokenRegex, revFormat, formats, } from \"./formatting\";\nimport { defaults } from \"../types/options\";\nimport { english } from \"../l10n/default\";\nexport var createDateFormatter = function (_a) {\n var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c, _d = _a.isMobile, isMobile = _d === void 0 ? false : _d;\n return function (dateObj, frmt, overrideLocale) {\n var locale = overrideLocale || l10n;\n if (config.formatDate !== undefined && !isMobile) {\n return config.formatDate(dateObj, frmt, locale);\n }\n return frmt\n .split(\"\")\n .map(function (c, i, arr) {\n return formats[c] && arr[i - 1] !== \"\\\\\"\n ? formats[c](dateObj, locale, config)\n : c !== \"\\\\\"\n ? c\n : \"\";\n })\n .join(\"\");\n };\n};\nexport var createDateParser = function (_a) {\n var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;\n return function (date, givenFormat, timeless, customLocale) {\n if (date !== 0 && !date)\n return undefined;\n var locale = customLocale || l10n;\n var parsedDate;\n var dateOrig = date;\n if (date instanceof Date)\n parsedDate = new Date(date.getTime());\n else if (typeof date !== \"string\" &&\n date.toFixed !== undefined)\n parsedDate = new Date(date);\n else if (typeof date === \"string\") {\n var format = givenFormat || (config || defaults).dateFormat;\n var datestr = String(date).trim();\n if (datestr === \"today\") {\n parsedDate = new Date();\n timeless = true;\n }\n else if (config && config.parseDate) {\n parsedDate = config.parseDate(date, format);\n }\n else if (/Z$/.test(datestr) ||\n /GMT$/.test(datestr)) {\n parsedDate = new Date(date);\n }\n else {\n var matched = void 0, ops = [];\n for (var i = 0, matchIndex = 0, regexStr = \"\"; i < format.length; i++) {\n var token = format[i];\n var isBackSlash = token === \"\\\\\";\n var escaped = format[i - 1] === \"\\\\\" || isBackSlash;\n if (tokenRegex[token] && !escaped) {\n regexStr += tokenRegex[token];\n var match = new RegExp(regexStr).exec(date);\n if (match && (matched = true)) {\n ops[token !== \"Y\" ? \"push\" : \"unshift\"]({\n fn: revFormat[token],\n val: match[++matchIndex],\n });\n }\n }\n else if (!isBackSlash)\n regexStr += \".\";\n }\n parsedDate =\n !config || !config.noCalendar\n ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)\n : new Date(new Date().setHours(0, 0, 0, 0));\n ops.forEach(function (_a) {\n var fn = _a.fn, val = _a.val;\n return (parsedDate = fn(parsedDate, val, locale) || parsedDate);\n });\n parsedDate = matched ? parsedDate : undefined;\n }\n }\n if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {\n config.errorHandler(new Error(\"Invalid date provided: \" + dateOrig));\n return undefined;\n }\n if (timeless === true)\n parsedDate.setHours(0, 0, 0, 0);\n return parsedDate;\n };\n};\nexport function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n}\nexport function compareTimes(date1, date2) {\n return (3600 * (date1.getHours() - date2.getHours()) +\n 60 * (date1.getMinutes() - date2.getMinutes()) +\n date1.getSeconds() -\n date2.getSeconds());\n}\nexport var isBetween = function (ts, ts1, ts2) {\n return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);\n};\nexport var calculateSecondsSinceMidnight = function (hours, minutes, seconds) {\n return hours * 3600 + minutes * 60 + seconds;\n};\nexport var parseSeconds = function (secondsSinceMidnight) {\n var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60;\n return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60];\n};\nexport var duration = {\n DAY: 86400000,\n};\nexport function getDefaultHours(config) {\n var hours = config.defaultHour;\n var minutes = config.defaultMinute;\n var seconds = config.defaultSeconds;\n if (config.minDate !== undefined) {\n var minHour = config.minDate.getHours();\n var minMinutes = config.minDate.getMinutes();\n var minSeconds = config.minDate.getSeconds();\n if (hours < minHour) {\n hours = minHour;\n }\n if (hours === minHour && minutes < minMinutes) {\n minutes = minMinutes;\n }\n if (hours === minHour && minutes === minMinutes && seconds < minSeconds)\n seconds = config.minDate.getSeconds();\n }\n if (config.maxDate !== undefined) {\n var maxHr = config.maxDate.getHours();\n var maxMinutes = config.maxDate.getMinutes();\n hours = Math.min(hours, maxHr);\n if (hours === maxHr)\n minutes = Math.min(maxMinutes, minutes);\n if (hours === maxHr && minutes === maxMinutes)\n seconds = config.maxDate.getSeconds();\n }\n return { hours: hours, minutes: minutes, seconds: seconds };\n}\n", "\"use strict\";\nif (typeof Object.assign !== \"function\") {\n Object.assign = function (target) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!target) {\n throw TypeError(\"Cannot convert undefined or null to object\");\n }\n var _loop_1 = function (source) {\n if (source) {\n Object.keys(source).forEach(function (key) { return (target[key] = source[key]); });\n }\n };\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var source = args_1[_a];\n _loop_1(source);\n }\n return target;\n };\n}\n", "var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nimport { defaults as defaultOptions, HOOKS, } from \"./types/options\";\nimport English from \"./l10n/default\";\nimport { arrayify, debounce, int, pad } from \"./utils\";\nimport { clearNode, createElement, createNumberInput, findParent, toggleClass, getEventTarget, } from \"./utils/dom\";\nimport { compareDates, createDateParser, createDateFormatter, duration, isBetween, getDefaultHours, calculateSecondsSinceMidnight, parseSeconds, } from \"./utils/dates\";\nimport { tokenRegex, monthToStr } from \"./utils/formatting\";\nimport \"./utils/polyfills\";\nvar DEBOUNCED_CHANGE_MS = 300;\nfunction FlatpickrInstance(element, instanceConfig) {\n var self = {\n config: __assign(__assign({}, defaultOptions), flatpickr.defaultConfig),\n l10n: English,\n };\n self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });\n self._handlers = [];\n self.pluginElements = [];\n self.loadedPlugins = [];\n self._bind = bind;\n self._setHoursFromDate = setHoursFromDate;\n self._positionCalendar = positionCalendar;\n self.changeMonth = changeMonth;\n self.changeYear = changeYear;\n self.clear = clear;\n self.close = close;\n self.onMouseOver = onMouseOver;\n self._createElement = createElement;\n self.createDay = createDay;\n self.destroy = destroy;\n self.isEnabled = isEnabled;\n self.jumpToDate = jumpToDate;\n self.updateValue = updateValue;\n self.open = open;\n self.redraw = redraw;\n self.set = set;\n self.setDate = setDate;\n self.toggle = toggle;\n function setupHelperFunctions() {\n self.utils = {\n getDaysInMonth: function (month, yr) {\n if (month === void 0) { month = self.currentMonth; }\n if (yr === void 0) { yr = self.currentYear; }\n if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0))\n return 29;\n return self.l10n.daysInMonth[month];\n },\n };\n }\n function init() {\n self.element = self.input = element;\n self.isOpen = false;\n parseConfig();\n setupLocale();\n setupInputs();\n setupDates();\n setupHelperFunctions();\n if (!self.isMobile)\n build();\n bindEvents();\n if (self.selectedDates.length || self.config.noCalendar) {\n if (self.config.enableTime) {\n setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : undefined);\n }\n updateValue(false);\n }\n setCalendarWidth();\n var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n if (!self.isMobile && isSafari) {\n positionCalendar();\n }\n triggerEvent(\"onReady\");\n }\n function getClosestActiveElement() {\n var _a;\n return (((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode())\n .activeElement || document.activeElement);\n }\n function bindToInstance(fn) {\n return fn.bind(self);\n }\n function setCalendarWidth() {\n var config = self.config;\n if (config.weekNumbers === false && config.showMonths === 1) {\n return;\n }\n else if (config.noCalendar !== true) {\n window.requestAnimationFrame(function () {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.style.visibility = \"hidden\";\n self.calendarContainer.style.display = \"block\";\n }\n if (self.daysContainer !== undefined) {\n var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;\n self.daysContainer.style.width = daysWidth + \"px\";\n self.calendarContainer.style.width =\n daysWidth +\n (self.weekWrapper !== undefined\n ? self.weekWrapper.offsetWidth\n : 0) +\n \"px\";\n self.calendarContainer.style.removeProperty(\"visibility\");\n self.calendarContainer.style.removeProperty(\"display\");\n }\n });\n }\n }\n function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate === undefined ||\n compareDates(new Date(), self.config.minDate) >= 0\n ? new Date()\n : new Date(self.config.minDate.getTime());\n var defaults = getDefaultHours(self.config);\n defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds());\n self.selectedDates = [defaultDate];\n self.latestSelectedDateObj = defaultDate;\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }\n function ampm2military(hour, amPM) {\n return (hour % 12) + 12 * int(amPM === self.l10n.amPM[1]);\n }\n function military2ampm(hour) {\n switch (hour % 24) {\n case 0:\n case 12:\n return 12;\n default:\n return hour % 12;\n }\n }\n function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (self.config.maxTime !== undefined &&\n self.config.minTime !== undefined &&\n self.config.minTime > self.config.maxTime) {\n var minBound = calculateSecondsSinceMidnight(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds());\n var maxBound = calculateSecondsSinceMidnight(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds());\n var currentTime = calculateSecondsSinceMidnight(hours, minutes, seconds);\n if (currentTime > maxBound && currentTime < minBound) {\n var result = parseSeconds(minBound);\n hours = result[0];\n minutes = result[1];\n seconds = result[2];\n }\n }\n else {\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours() && minutes < minTime.getMinutes())\n minutes = minTime.getMinutes();\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n }\n setHours(hours, minutes, seconds);\n }\n function setHoursFromDate(dateObj) {\n var date = dateObj || self.latestSelectedDateObj;\n if (date && date instanceof Date) {\n setHours(date.getHours(), date.getMinutes(), date.getSeconds());\n }\n }\n function setHours(hours, minutes, seconds) {\n if (self.latestSelectedDateObj !== undefined) {\n self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);\n }\n if (!self.hourElement || !self.minuteElement || self.isMobile)\n return;\n self.hourElement.value = pad(!self.config.time_24hr\n ? ((12 + hours) % 12) + 12 * int(hours % 12 === 0)\n : hours);\n self.minuteElement.value = pad(minutes);\n if (self.amPM !== undefined)\n self.amPM.textContent = self.l10n.amPM[int(hours >= 12)];\n if (self.secondElement !== undefined)\n self.secondElement.value = pad(seconds);\n }\n function onYearInput(event) {\n var eventTarget = getEventTarget(event);\n var year = parseInt(eventTarget.value) + (event.delta || 0);\n if (year / 1000 > 1 ||\n (event.key === \"Enter\" && !/[^\\d]/.test(year.toString()))) {\n changeYear(year);\n }\n }\n function bind(element, event, handler, options) {\n if (event instanceof Array)\n return event.forEach(function (ev) { return bind(element, ev, handler, options); });\n if (element instanceof Array)\n return element.forEach(function (el) { return bind(el, event, handler, options); });\n element.addEventListener(event, handler, options);\n self._handlers.push({\n remove: function () { return element.removeEventListener(event, handler, options); },\n });\n }\n function triggerChange() {\n triggerEvent(\"onChange\");\n }\n function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(getEventTarget(e));\n });\n bind(self._input, \"keydown\", onKeyDown);\n if (self.calendarContainer !== undefined) {\n bind(self.calendarContainer, \"keydown\", onKeyDown);\n }\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", documentClick);\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"click\", onMonthNavClick);\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"click\", selectDate);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return getEventTarget(e).select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"click\", timeIncrement);\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"click\", function (e) {\n updateTime(e);\n });\n }\n }\n if (self.config.allowInput) {\n bind(self._input, \"blur\", onBlur);\n }\n }\n function jumpToDate(jumpDate, triggerChange) {\n var jumpTo = jumpDate !== undefined\n ? self.parseDate(jumpDate)\n : self.latestSelectedDateObj ||\n (self.config.minDate && self.config.minDate > self.now\n ? self.config.minDate\n : self.config.maxDate && self.config.maxDate < self.now\n ? self.config.maxDate\n : self.now);\n var oldYear = self.currentYear;\n var oldMonth = self.currentMonth;\n try {\n if (jumpTo !== undefined) {\n self.currentYear = jumpTo.getFullYear();\n self.currentMonth = jumpTo.getMonth();\n }\n }\n catch (e) {\n e.message = \"Invalid date supplied: \" + jumpTo;\n self.config.errorHandler(e);\n }\n if (triggerChange && self.currentYear !== oldYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n if (triggerChange &&\n (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) {\n triggerEvent(\"onMonthChange\");\n }\n self.redraw();\n }\n function timeIncrement(e) {\n var eventTarget = getEventTarget(e);\n if (~eventTarget.className.indexOf(\"arrow\"))\n incrementNumInput(e, eventTarget.classList.contains(\"arrowUp\") ? 1 : -1);\n }\n function incrementNumInput(e, delta, inputElem) {\n var target = e && getEventTarget(e);\n var input = inputElem ||\n (target && target.parentNode && target.parentNode.firstChild);\n var event = createEvent(\"increment\");\n event.delta = delta;\n input && input.dispatchEvent(event);\n }\n function build() {\n var fragment = window.document.createDocumentFragment();\n self.calendarContainer = createElement(\"div\", \"flatpickr-calendar\");\n self.calendarContainer.tabIndex = -1;\n if (!self.config.noCalendar) {\n fragment.appendChild(buildMonthNav());\n self.innerContainer = createElement(\"div\", \"flatpickr-innerContainer\");\n if (self.config.weekNumbers) {\n var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers;\n self.innerContainer.appendChild(weekWrapper);\n self.weekNumbers = weekNumbers;\n self.weekWrapper = weekWrapper;\n }\n self.rContainer = createElement(\"div\", \"flatpickr-rContainer\");\n self.rContainer.appendChild(buildWeekdays());\n if (!self.daysContainer) {\n self.daysContainer = createElement(\"div\", \"flatpickr-days\");\n self.daysContainer.tabIndex = -1;\n }\n buildDays();\n self.rContainer.appendChild(self.daysContainer);\n self.innerContainer.appendChild(self.rContainer);\n fragment.appendChild(self.innerContainer);\n }\n if (self.config.enableTime) {\n fragment.appendChild(buildTime());\n }\n toggleClass(self.calendarContainer, \"rangeMode\", self.config.mode === \"range\");\n toggleClass(self.calendarContainer, \"animate\", self.config.animate === true);\n toggleClass(self.calendarContainer, \"multiMonth\", self.config.showMonths > 1);\n self.calendarContainer.appendChild(fragment);\n var customAppend = self.config.appendTo !== undefined &&\n self.config.appendTo.nodeType !== undefined;\n if (self.config.inline || self.config.static) {\n self.calendarContainer.classList.add(self.config.inline ? \"inline\" : \"static\");\n if (self.config.inline) {\n if (!customAppend && self.element.parentNode)\n self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);\n else if (self.config.appendTo !== undefined)\n self.config.appendTo.appendChild(self.calendarContainer);\n }\n if (self.config.static) {\n var wrapper = createElement(\"div\", \"flatpickr-wrapper\");\n if (self.element.parentNode)\n self.element.parentNode.insertBefore(wrapper, self.element);\n wrapper.appendChild(self.element);\n if (self.altInput)\n wrapper.appendChild(self.altInput);\n wrapper.appendChild(self.calendarContainer);\n }\n }\n if (!self.config.static && !self.config.inline)\n (self.config.appendTo !== undefined\n ? self.config.appendTo\n : window.document.body).appendChild(self.calendarContainer);\n }\n function createDay(className, date, _dayNumber, i) {\n var dateIsEnabled = isEnabled(date, true), dayElement = createElement(\"span\", className, date.getDate().toString());\n dayElement.dateObj = date;\n dayElement.$i = i;\n dayElement.setAttribute(\"aria-label\", self.formatDate(date, self.config.ariaDateFormat));\n if (className.indexOf(\"hidden\") === -1 &&\n compareDates(date, self.now) === 0) {\n self.todayDateElem = dayElement;\n dayElement.classList.add(\"today\");\n dayElement.setAttribute(\"aria-current\", \"date\");\n }\n if (dateIsEnabled) {\n dayElement.tabIndex = -1;\n if (isDateSelected(date)) {\n dayElement.classList.add(\"selected\");\n self.selectedDateElem = dayElement;\n if (self.config.mode === \"range\") {\n toggleClass(dayElement, \"startRange\", self.selectedDates[0] &&\n compareDates(date, self.selectedDates[0], true) === 0);\n toggleClass(dayElement, \"endRange\", self.selectedDates[1] &&\n compareDates(date, self.selectedDates[1], true) === 0);\n if (className === \"nextMonthDay\")\n dayElement.classList.add(\"inRange\");\n }\n }\n }\n else {\n dayElement.classList.add(\"flatpickr-disabled\");\n }\n if (self.config.mode === \"range\") {\n if (isDateInRange(date) && !isDateSelected(date))\n dayElement.classList.add(\"inRange\");\n }\n if (self.weekNumbers &&\n self.config.showMonths === 1 &&\n className !== \"prevMonthDay\" &&\n i % 7 === 6) {\n self.weekNumbers.insertAdjacentHTML(\"beforeend\", \"<span class='flatpickr-day'>\" + self.config.getWeek(date) + \"</span>\");\n }\n triggerEvent(\"onDayCreate\", dayElement);\n return dayElement;\n }\n function focusOnDayElem(targetNode) {\n targetNode.focus();\n if (self.config.mode === \"range\")\n onMouseOver(targetNode);\n }\n function getFirstAvailableDay(delta) {\n var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n for (var m = startMonth; m != endMonth; m += delta) {\n var month = self.daysContainer.children[m];\n var startIndex = delta > 0 ? 0 : month.children.length - 1;\n var endIndex = delta > 0 ? month.children.length : -1;\n for (var i = startIndex; i != endIndex; i += delta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 && isEnabled(c.dateObj))\n return c;\n }\n }\n return undefined;\n }\n function getNextAvailableDay(current, delta) {\n var givenMonth = current.className.indexOf(\"Month\") === -1\n ? current.dateObj.getMonth()\n : self.currentMonth;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n var loopDelta = delta > 0 ? 1 : -1;\n for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {\n var month = self.daysContainer.children[m];\n var startIndex = givenMonth - self.currentMonth === m\n ? current.$i + delta\n : delta < 0\n ? month.children.length - 1\n : 0;\n var numMonthDays = month.children.length;\n for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 &&\n isEnabled(c.dateObj) &&\n Math.abs(current.$i - i) >= Math.abs(delta))\n return focusOnDayElem(c);\n }\n }\n self.changeMonth(loopDelta);\n focusOnDay(getFirstAvailableDay(loopDelta), 0);\n return undefined;\n }\n function focusOnDay(current, offset) {\n var activeElement = getClosestActiveElement();\n var dayFocused = isInView(activeElement || document.body);\n var startElem = current !== undefined\n ? current\n : dayFocused\n ? activeElement\n : self.selectedDateElem !== undefined && isInView(self.selectedDateElem)\n ? self.selectedDateElem\n : self.todayDateElem !== undefined && isInView(self.todayDateElem)\n ? self.todayDateElem\n : getFirstAvailableDay(offset > 0 ? 1 : -1);\n if (startElem === undefined) {\n self._input.focus();\n }\n else if (!dayFocused) {\n focusOnDayElem(startElem);\n }\n else {\n getNextAvailableDay(startElem, offset);\n }\n }\n function buildMonthDays(year, month) {\n var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;\n var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year);\n var daysInMonth = self.utils.getDaysInMonth(month, year), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? \"prevMonthDay hidden\" : \"prevMonthDay\", nextMonthDayClass = isMultiMonth ? \"nextMonthDay hidden\" : \"nextMonthDay\";\n var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0;\n for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {\n days.appendChild(createDay(\"flatpickr-day \" + prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));\n }\n for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {\n days.appendChild(createDay(\"flatpickr-day\", new Date(year, month, dayNumber), dayNumber, dayIndex));\n }\n for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth &&\n (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {\n days.appendChild(createDay(\"flatpickr-day \" + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));\n }\n var dayContainer = createElement(\"div\", \"dayContainer\");\n dayContainer.appendChild(days);\n return dayContainer;\n }\n function buildDays() {\n if (self.daysContainer === undefined) {\n return;\n }\n clearNode(self.daysContainer);\n if (self.weekNumbers)\n clearNode(self.weekNumbers);\n var frag = document.createDocumentFragment();\n for (var i = 0; i < self.config.showMonths; i++) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));\n }\n self.daysContainer.appendChild(frag);\n self.days = self.daysContainer.firstChild;\n if (self.config.mode === \"range\" && self.selectedDates.length === 1) {\n onMouseOver();\n }\n }\n function buildMonthSwitch() {\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType !== \"dropdown\")\n return;\n var shouldBuildMonth = function (month) {\n if (self.config.minDate !== undefined &&\n self.currentYear === self.config.minDate.getFullYear() &&\n month < self.config.minDate.getMonth()) {\n return false;\n }\n return !(self.config.maxDate !== undefined &&\n self.currentYear === self.config.maxDate.getFullYear() &&\n month > self.config.maxDate.getMonth());\n };\n self.monthsDropdownContainer.tabIndex = -1;\n self.monthsDropdownContainer.innerHTML = \"\";\n for (var i = 0; i < 12; i++) {\n if (!shouldBuildMonth(i))\n continue;\n var month = createElement(\"option\", \"flatpickr-monthDropdown-month\");\n month.value = new Date(self.currentYear, i).getMonth().toString();\n month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n);\n month.tabIndex = -1;\n if (self.currentMonth === i) {\n month.selected = true;\n }\n self.monthsDropdownContainer.appendChild(month);\n }\n }\n function buildMonth() {\n var container = createElement(\"div\", \"flatpickr-month\");\n var monthNavFragment = window.document.createDocumentFragment();\n var monthElement;\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType === \"static\") {\n monthElement = createElement(\"span\", \"cur-month\");\n }\n else {\n self.monthsDropdownContainer = createElement(\"select\", \"flatpickr-monthDropdown-months\");\n self.monthsDropdownContainer.setAttribute(\"aria-label\", self.l10n.monthAriaLabel);\n bind(self.monthsDropdownContainer, \"change\", function (e) {\n var target = getEventTarget(e);\n var selectedMonth = parseInt(target.value, 10);\n self.changeMonth(selectedMonth - self.currentMonth);\n triggerEvent(\"onMonthChange\");\n });\n buildMonthSwitch();\n monthElement = self.monthsDropdownContainer;\n }\n var yearInput = createNumberInput(\"cur-year\", { tabindex: \"-1\" });\n var yearElement = yearInput.getElementsByTagName(\"input\")[0];\n yearElement.setAttribute(\"aria-label\", self.l10n.yearAriaLabel);\n if (self.config.minDate) {\n yearElement.setAttribute(\"min\", self.config.minDate.getFullYear().toString());\n }\n if (self.config.maxDate) {\n yearElement.setAttribute(\"max\", self.config.maxDate.getFullYear().toString());\n yearElement.disabled =\n !!self.config.minDate &&\n self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();\n }\n var currentMonth = createElement(\"div\", \"flatpickr-current-month\");\n currentMonth.appendChild(monthElement);\n currentMonth.appendChild(yearInput);\n monthNavFragment.appendChild(currentMonth);\n container.appendChild(monthNavFragment);\n return {\n container: container,\n yearElement: yearElement,\n monthElement: monthElement,\n };\n }\n function buildMonths() {\n clearNode(self.monthNav);\n self.monthNav.appendChild(self.prevMonthNav);\n if (self.config.showMonths) {\n self.yearElements = [];\n self.monthElements = [];\n }\n for (var m = self.config.showMonths; m--;) {\n var month = buildMonth();\n self.yearElements.push(month.yearElement);\n self.monthElements.push(month.monthElement);\n self.monthNav.appendChild(month.container);\n }\n self.monthNav.appendChild(self.nextMonthNav);\n }\n function buildMonthNav() {\n self.monthNav = createElement(\"div\", \"flatpickr-months\");\n self.yearElements = [];\n self.monthElements = [];\n self.prevMonthNav = createElement(\"span\", \"flatpickr-prev-month\");\n self.prevMonthNav.innerHTML = self.config.prevArrow;\n self.nextMonthNav = createElement(\"span\", \"flatpickr-next-month\");\n self.nextMonthNav.innerHTML = self.config.nextArrow;\n buildMonths();\n Object.defineProperty(self, \"_hidePrevMonthArrow\", {\n get: function () { return self.__hidePrevMonthArrow; },\n set: function (bool) {\n if (self.__hidePrevMonthArrow !== bool) {\n toggleClass(self.prevMonthNav, \"flatpickr-disabled\", bool);\n self.__hidePrevMonthArrow = bool;\n }\n },\n });\n Object.defineProperty(self, \"_hideNextMonthArrow\", {\n get: function () { return self.__hideNextMonthArrow; },\n set: function (bool) {\n if (self.__hideNextMonthArrow !== bool) {\n toggleClass(self.nextMonthNav, \"flatpickr-disabled\", bool);\n self.__hideNextMonthArrow = bool;\n }\n },\n });\n self.currentYearElement = self.yearElements[0];\n updateNavigationCurrentMonth();\n return self.monthNav;\n }\n function buildTime() {\n self.calendarContainer.classList.add(\"hasTime\");\n if (self.config.noCalendar)\n self.calendarContainer.classList.add(\"noCalendar\");\n var defaults = getDefaultHours(self.config);\n self.timeContainer = createElement(\"div\", \"flatpickr-time\");\n self.timeContainer.tabIndex = -1;\n var separator = createElement(\"span\", \"flatpickr-time-separator\", \":\");\n var hourInput = createNumberInput(\"flatpickr-hour\", {\n \"aria-label\": self.l10n.hourAriaLabel,\n });\n self.hourElement = hourInput.getElementsByTagName(\"input\")[0];\n var minuteInput = createNumberInput(\"flatpickr-minute\", {\n \"aria-label\": self.l10n.minuteAriaLabel,\n });\n self.minuteElement = minuteInput.getElementsByTagName(\"input\")[0];\n self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;\n self.hourElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getHours()\n : self.config.time_24hr\n ? defaults.hours\n : military2ampm(defaults.hours));\n self.minuteElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getMinutes()\n : defaults.minutes);\n self.hourElement.setAttribute(\"step\", self.config.hourIncrement.toString());\n self.minuteElement.setAttribute(\"step\", self.config.minuteIncrement.toString());\n self.hourElement.setAttribute(\"min\", self.config.time_24hr ? \"0\" : \"1\");\n self.hourElement.setAttribute(\"max\", self.config.time_24hr ? \"23\" : \"12\");\n self.hourElement.setAttribute(\"maxlength\", \"2\");\n self.minuteElement.setAttribute(\"min\", \"0\");\n self.minuteElement.setAttribute(\"max\", \"59\");\n self.minuteElement.setAttribute(\"maxlength\", \"2\");\n self.timeContainer.appendChild(hourInput);\n self.timeContainer.appendChild(separator);\n self.timeContainer.appendChild(minuteInput);\n if (self.config.time_24hr)\n self.timeContainer.classList.add(\"time24hr\");\n if (self.config.enableSeconds) {\n self.timeContainer.classList.add(\"hasSeconds\");\n var secondInput = createNumberInput(\"flatpickr-second\");\n self.secondElement = secondInput.getElementsByTagName(\"input\")[0];\n self.secondElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getSeconds()\n : defaults.seconds);\n self.secondElement.setAttribute(\"step\", self.minuteElement.getAttribute(\"step\"));\n self.secondElement.setAttribute(\"min\", \"0\");\n self.secondElement.setAttribute(\"max\", \"59\");\n self.secondElement.setAttribute(\"maxlength\", \"2\");\n self.timeContainer.appendChild(createElement(\"span\", \"flatpickr-time-separator\", \":\"));\n self.timeContainer.appendChild(secondInput);\n }\n if (!self.config.time_24hr) {\n self.amPM = createElement(\"span\", \"flatpickr-am-pm\", self.l10n.amPM[int((self.latestSelectedDateObj\n ? self.hourElement.value\n : self.config.defaultHour) > 11)]);\n self.amPM.title = self.l10n.toggleTitle;\n self.amPM.tabIndex = -1;\n self.timeContainer.appendChild(self.amPM);\n }\n return self.timeContainer;\n }\n function buildWeekdays() {\n if (!self.weekdayContainer)\n self.weekdayContainer = createElement(\"div\", \"flatpickr-weekdays\");\n else\n clearNode(self.weekdayContainer);\n for (var i = self.config.showMonths; i--;) {\n var container = createElement(\"div\", \"flatpickr-weekdaycontainer\");\n self.weekdayContainer.appendChild(container);\n }\n updateWeekdays();\n return self.weekdayContainer;\n }\n function updateWeekdays() {\n if (!self.weekdayContainer) {\n return;\n }\n var firstDayOfWeek = self.l10n.firstDayOfWeek;\n var weekdays = __spreadArrays(self.l10n.weekdays.shorthand);\n if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {\n weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek));\n }\n for (var i = self.config.showMonths; i--;) {\n self.weekdayContainer.children[i].innerHTML = \"\\n <span class='flatpickr-weekday'>\\n \" + weekdays.join(\"</span><span class='flatpickr-weekday'>\") + \"\\n </span>\\n \";\n }\n }\n function buildWeeks() {\n self.calendarContainer.classList.add(\"hasWeeks\");\n var weekWrapper = createElement(\"div\", \"flatpickr-weekwrapper\");\n weekWrapper.appendChild(createElement(\"span\", \"flatpickr-weekday\", self.l10n.weekAbbreviation));\n var weekNumbers = createElement(\"div\", \"flatpickr-weeks\");\n weekWrapper.appendChild(weekNumbers);\n return {\n weekWrapper: weekWrapper,\n weekNumbers: weekNumbers,\n };\n }\n function changeMonth(value, isOffset) {\n if (isOffset === void 0) { isOffset = true; }\n var delta = isOffset ? value : value - self.currentMonth;\n if ((delta < 0 && self._hidePrevMonthArrow === true) ||\n (delta > 0 && self._hideNextMonthArrow === true))\n return;\n self.currentMonth += delta;\n if (self.currentMonth < 0 || self.currentMonth > 11) {\n self.currentYear += self.currentMonth > 11 ? 1 : -1;\n self.currentMonth = (self.currentMonth + 12) % 12;\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n buildDays();\n triggerEvent(\"onMonthChange\");\n updateNavigationCurrentMonth();\n }\n function clear(triggerChangeEvent, toInitial) {\n if (triggerChangeEvent === void 0) { triggerChangeEvent = true; }\n if (toInitial === void 0) { toInitial = true; }\n self.input.value = \"\";\n if (self.altInput !== undefined)\n self.altInput.value = \"\";\n if (self.mobileInput !== undefined)\n self.mobileInput.value = \"\";\n self.selectedDates = [];\n self.latestSelectedDateObj = undefined;\n if (toInitial === true) {\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n }\n if (self.config.enableTime === true) {\n var _a = getDefaultHours(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n setHours(hours, minutes, seconds);\n }\n self.redraw();\n if (triggerChangeEvent)\n triggerEvent(\"onChange\");\n }\n function close() {\n self.isOpen = false;\n if (!self.isMobile) {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.classList.remove(\"open\");\n }\n if (self._input !== undefined) {\n self._input.classList.remove(\"active\");\n }\n }\n triggerEvent(\"onClose\");\n }\n function destroy() {\n if (self.config !== undefined)\n triggerEvent(\"onDestroy\");\n for (var i = self._handlers.length; i--;) {\n self._handlers[i].remove();\n }\n self._handlers = [];\n if (self.mobileInput) {\n if (self.mobileInput.parentNode)\n self.mobileInput.parentNode.removeChild(self.mobileInput);\n self.mobileInput = undefined;\n }\n else if (self.calendarContainer && self.calendarContainer.parentNode) {\n if (self.config.static && self.calendarContainer.parentNode) {\n var wrapper = self.calendarContainer.parentNode;\n wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);\n if (wrapper.parentNode) {\n while (wrapper.firstChild)\n wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);\n wrapper.parentNode.removeChild(wrapper);\n }\n }\n else\n self.calendarContainer.parentNode.removeChild(self.calendarContainer);\n }\n if (self.altInput) {\n self.input.type = \"text\";\n if (self.altInput.parentNode)\n self.altInput.parentNode.removeChild(self.altInput);\n delete self.altInput;\n }\n if (self.input) {\n self.input.type = self.input._type;\n self.input.classList.remove(\"flatpickr-input\");\n self.input.removeAttribute(\"readonly\");\n }\n [\n \"_showTimeInput\",\n \"latestSelectedDateObj\",\n \"_hideNextMonthArrow\",\n \"_hidePrevMonthArrow\",\n \"__hideNextMonthArrow\",\n \"__hidePrevMonthArrow\",\n \"isMobile\",\n \"isOpen\",\n \"selectedDateElem\",\n \"minDateHasTime\",\n \"maxDateHasTime\",\n \"days\",\n \"daysContainer\",\n \"_input\",\n \"_positionElement\",\n \"innerContainer\",\n \"rContainer\",\n \"monthNav\",\n \"todayDateElem\",\n \"calendarContainer\",\n \"weekdayContainer\",\n \"prevMonthNav\",\n \"nextMonthNav\",\n \"monthsDropdownContainer\",\n \"currentMonthElement\",\n \"currentYearElement\",\n \"navigationCurrentMonth\",\n \"selectedDateElem\",\n \"config\",\n ].forEach(function (k) {\n try {\n delete self[k];\n }\n catch (_) { }\n });\n }\n function isCalendarElem(elem) {\n return self.calendarContainer.contains(elem);\n }\n function documentClick(e) {\n if (self.isOpen && !self.config.inline) {\n var eventTarget_1 = getEventTarget(e);\n var isCalendarElement = isCalendarElem(eventTarget_1);\n var isInput = eventTarget_1 === self.input ||\n eventTarget_1 === self.altInput ||\n self.element.contains(eventTarget_1) ||\n (e.path &&\n e.path.indexOf &&\n (~e.path.indexOf(self.input) ||\n ~e.path.indexOf(self.altInput)));\n var lostFocus = !isInput &&\n !isCalendarElement &&\n !isCalendarElem(e.relatedTarget);\n var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {\n return elem.contains(eventTarget_1);\n });\n if (lostFocus && isIgnored) {\n if (self.config.allowInput) {\n self.setDate(self._input.value, false, self.config.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined &&\n self.input.value !== \"\" &&\n self.input.value !== undefined) {\n updateTime();\n }\n self.close();\n if (self.config &&\n self.config.mode === \"range\" &&\n self.selectedDates.length === 1)\n self.clear(false);\n }\n }\n }\n function changeYear(newYear) {\n if (!newYear ||\n (self.config.minDate && newYear < self.config.minDate.getFullYear()) ||\n (self.config.maxDate && newYear > self.config.maxDate.getFullYear()))\n return;\n var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum;\n self.currentYear = newYearNum || self.currentYear;\n if (self.config.maxDate &&\n self.currentYear === self.config.maxDate.getFullYear()) {\n self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);\n }\n else if (self.config.minDate &&\n self.currentYear === self.config.minDate.getFullYear()) {\n self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);\n }\n if (isNewYear) {\n self.redraw();\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n }\n function isEnabled(date, timeless) {\n var _a;\n if (timeless === void 0) { timeless = true; }\n var dateToCheck = self.parseDate(date, undefined, timeless);\n if ((self.config.minDate &&\n dateToCheck &&\n compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) ||\n (self.config.maxDate &&\n dateToCheck &&\n compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0))\n return false;\n if (!self.config.enable && self.config.disable.length === 0)\n return true;\n if (dateToCheck === undefined)\n return false;\n var bool = !!self.config.enable, array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable;\n for (var i = 0, d = void 0; i < array.length; i++) {\n d = array[i];\n if (typeof d === \"function\" &&\n d(dateToCheck))\n return bool;\n else if (d instanceof Date &&\n dateToCheck !== undefined &&\n d.getTime() === dateToCheck.getTime())\n return bool;\n else if (typeof d === \"string\") {\n var parsed = self.parseDate(d, undefined, true);\n return parsed && parsed.getTime() === dateToCheck.getTime()\n ? bool\n : !bool;\n }\n else if (typeof d === \"object\" &&\n dateToCheck !== undefined &&\n d.from &&\n d.to &&\n dateToCheck.getTime() >= d.from.getTime() &&\n dateToCheck.getTime() <= d.to.getTime())\n return bool;\n }\n return !bool;\n }\n function isInView(elem) {\n if (self.daysContainer !== undefined)\n return (elem.className.indexOf(\"hidden\") === -1 &&\n elem.className.indexOf(\"flatpickr-disabled\") === -1 &&\n self.daysContainer.contains(elem));\n return false;\n }\n function onBlur(e) {\n var isInput = e.target === self._input;\n var valueChanged = self._input.value.trimEnd() !== getDateStr();\n if (isInput &&\n valueChanged &&\n !(e.relatedTarget && isCalendarElem(e.relatedTarget))) {\n self.setDate(self._input.value, true, e.target === self.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n }\n }\n function onKeyDown(e) {\n var eventTarget = getEventTarget(e);\n var isInput = self.config.wrap\n ? element.contains(eventTarget)\n : eventTarget === self._input;\n var allowInput = self.config.allowInput;\n var allowKeydown = self.isOpen && (!allowInput || !isInput);\n var allowInlineKeydown = self.config.inline && isInput && !allowInput;\n if (e.keyCode === 13 && isInput) {\n if (allowInput) {\n self.setDate(self._input.value, true, eventTarget === self.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n self.close();\n return eventTarget.blur();\n }\n else {\n self.open();\n }\n }\n else if (isCalendarElem(eventTarget) ||\n allowKeydown ||\n allowInlineKeydown) {\n var isTimeObj = !!self.timeContainer &&\n self.timeContainer.contains(eventTarget);\n switch (e.keyCode) {\n case 13:\n if (isTimeObj) {\n e.preventDefault();\n updateTime();\n focusAndClose();\n }\n else\n selectDate(e);\n break;\n case 27:\n e.preventDefault();\n focusAndClose();\n break;\n case 8:\n case 46:\n if (isInput && !self.config.allowInput) {\n e.preventDefault();\n self.clear();\n }\n break;\n case 37:\n case 39:\n if (!isTimeObj && !isInput) {\n e.preventDefault();\n var activeElement = getClosestActiveElement();\n if (self.daysContainer !== undefined &&\n (allowInput === false ||\n (activeElement && isInView(activeElement)))) {\n var delta_1 = e.keyCode === 39 ? 1 : -1;\n if (!e.ctrlKey)\n focusOnDay(undefined, delta_1);\n else {\n e.stopPropagation();\n changeMonth(delta_1);\n focusOnDay(getFirstAvailableDay(1), 0);\n }\n }\n }\n else if (self.hourElement)\n self.hourElement.focus();\n break;\n case 38:\n case 40:\n e.preventDefault();\n var delta = e.keyCode === 40 ? 1 : -1;\n if ((self.daysContainer &&\n eventTarget.$i !== undefined) ||\n eventTarget === self.input ||\n eventTarget === self.altInput) {\n if (e.ctrlKey) {\n e.stopPropagation();\n changeYear(self.currentYear - delta);\n focusOnDay(getFirstAvailableDay(1), 0);\n }\n else if (!isTimeObj)\n focusOnDay(undefined, delta * 7);\n }\n else if (eventTarget === self.currentYearElement) {\n changeYear(self.currentYear - delta);\n }\n else if (self.config.enableTime) {\n if (!isTimeObj && self.hourElement)\n self.hourElement.focus();\n updateTime(e);\n self._debouncedChange();\n }\n break;\n case 9:\n if (isTimeObj) {\n var elems = [\n self.hourElement,\n self.minuteElement,\n self.secondElement,\n self.amPM,\n ]\n .concat(self.pluginElements)\n .filter(function (x) { return x; });\n var i = elems.indexOf(eventTarget);\n if (i !== -1) {\n var target = elems[i + (e.shiftKey ? -1 : 1)];\n e.preventDefault();\n (target || self._input).focus();\n }\n }\n else if (!self.config.noCalendar &&\n self.daysContainer &&\n self.daysContainer.contains(eventTarget) &&\n e.shiftKey) {\n e.preventDefault();\n self._input.focus();\n }\n break;\n default:\n break;\n }\n }\n if (self.amPM !== undefined && eventTarget === self.amPM) {\n switch (e.key) {\n case self.l10n.amPM[0].charAt(0):\n case self.l10n.amPM[0].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[0];\n setHoursFromInputs();\n updateValue();\n break;\n case self.l10n.amPM[1].charAt(0):\n case self.l10n.amPM[1].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[1];\n setHoursFromInputs();\n updateValue();\n break;\n }\n }\n if (isInput || isCalendarElem(eventTarget)) {\n triggerEvent(\"onKeyDown\", e);\n }\n }\n function onMouseOver(elem, cellClass) {\n if (cellClass === void 0) { cellClass = \"flatpickr-day\"; }\n if (self.selectedDates.length !== 1 ||\n (elem &&\n (!elem.classList.contains(cellClass) ||\n elem.classList.contains(\"flatpickr-disabled\"))))\n return;\n var hoverDate = elem\n ? elem.dateObj.getTime()\n : self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime());\n var containsDisabled = false;\n var minRange = 0, maxRange = 0;\n for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) {\n if (!isEnabled(new Date(t), true)) {\n containsDisabled =\n containsDisabled || (t > rangeStartDate && t < rangeEndDate);\n if (t < initialDate && (!minRange || t > minRange))\n minRange = t;\n else if (t > initialDate && (!maxRange || t < maxRange))\n maxRange = t;\n }\n }\n var hoverableCells = Array.from(self.rContainer.querySelectorAll(\"*:nth-child(-n+\" + self.config.showMonths + \") > .\" + cellClass));\n hoverableCells.forEach(function (dayElem) {\n var date = dayElem.dateObj;\n var timestamp = date.getTime();\n var outOfRange = (minRange > 0 && timestamp < minRange) ||\n (maxRange > 0 && timestamp > maxRange);\n if (outOfRange) {\n dayElem.classList.add(\"notAllowed\");\n [\"inRange\", \"startRange\", \"endRange\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n return;\n }\n else if (containsDisabled && !outOfRange)\n return;\n [\"startRange\", \"inRange\", \"endRange\", \"notAllowed\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n if (elem !== undefined) {\n elem.classList.add(hoverDate <= self.selectedDates[0].getTime()\n ? \"startRange\"\n : \"endRange\");\n if (initialDate < hoverDate && timestamp === initialDate)\n dayElem.classList.add(\"startRange\");\n else if (initialDate > hoverDate && timestamp === initialDate)\n dayElem.classList.add(\"endRange\");\n if (timestamp >= minRange &&\n (maxRange === 0 || timestamp <= maxRange) &&\n isBetween(timestamp, initialDate, hoverDate))\n dayElem.classList.add(\"inRange\");\n }\n });\n }\n function onResize() {\n if (self.isOpen && !self.config.static && !self.config.inline)\n positionCalendar();\n }\n function open(e, positionElement) {\n if (positionElement === void 0) { positionElement = self._positionElement; }\n if (self.isMobile === true) {\n if (e) {\n e.preventDefault();\n var eventTarget = getEventTarget(e);\n if (eventTarget) {\n eventTarget.blur();\n }\n }\n if (self.mobileInput !== undefined) {\n self.mobileInput.focus();\n self.mobileInput.click();\n }\n triggerEvent(\"onOpen\");\n return;\n }\n else if (self._input.disabled || self.config.inline) {\n return;\n }\n var wasOpen = self.isOpen;\n self.isOpen = true;\n if (!wasOpen) {\n self.calendarContainer.classList.add(\"open\");\n self._input.classList.add(\"active\");\n triggerEvent(\"onOpen\");\n positionCalendar(positionElement);\n }\n if (self.config.enableTime === true && self.config.noCalendar === true) {\n if (self.config.allowInput === false &&\n (e === undefined ||\n !self.timeContainer.contains(e.relatedTarget))) {\n setTimeout(function () { return self.hourElement.select(); }, 50);\n }\n }\n }\n function minMaxDateSetter(type) {\n return function (date) {\n var dateObj = (self.config[\"_\" + type + \"Date\"] = self.parseDate(date, self.config.dateFormat));\n var inverseDateObj = self.config[\"_\" + (type === \"min\" ? \"max\" : \"min\") + \"Date\"];\n if (dateObj !== undefined) {\n self[type === \"min\" ? \"minDateHasTime\" : \"maxDateHasTime\"] =\n dateObj.getHours() > 0 ||\n dateObj.getMinutes() > 0 ||\n dateObj.getSeconds() > 0;\n }\n if (self.selectedDates) {\n self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); });\n if (!self.selectedDates.length && type === \"min\")\n setHoursFromDate(dateObj);\n updateValue();\n }\n if (self.daysContainer) {\n redraw();\n if (dateObj !== undefined)\n self.currentYearElement[type] = dateObj.getFullYear().toString();\n else\n self.currentYearElement.removeAttribute(type);\n self.currentYearElement.disabled =\n !!inverseDateObj &&\n dateObj !== undefined &&\n inverseDateObj.getFullYear() === dateObj.getFullYear();\n }\n };\n }\n function parseConfig() {\n var boolOpts = [\n \"wrap\",\n \"weekNumbers\",\n \"allowInput\",\n \"allowInvalidPreload\",\n \"clickOpens\",\n \"time_24hr\",\n \"enableTime\",\n \"noCalendar\",\n \"altInput\",\n \"shorthandCurrentMonth\",\n \"inline\",\n \"static\",\n \"enableSeconds\",\n \"disableMobile\",\n ];\n var userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig);\n var formats = {};\n self.config.parseDate = userConfig.parseDate;\n self.config.formatDate = userConfig.formatDate;\n Object.defineProperty(self.config, \"enable\", {\n get: function () { return self.config._enable; },\n set: function (dates) {\n self.config._enable = parseDateRules(dates);\n },\n });\n Object.defineProperty(self.config, \"disable\", {\n get: function () { return self.config._disable; },\n set: function (dates) {\n self.config._disable = parseDateRules(dates);\n },\n });\n var timeMode = userConfig.mode === \"time\";\n if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {\n var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaultOptions.dateFormat;\n formats.dateFormat =\n userConfig.noCalendar || timeMode\n ? \"H:i\" + (userConfig.enableSeconds ? \":S\" : \"\")\n : defaultDateFormat + \" H:i\" + (userConfig.enableSeconds ? \":S\" : \"\");\n }\n if (userConfig.altInput &&\n (userConfig.enableTime || timeMode) &&\n !userConfig.altFormat) {\n var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaultOptions.altFormat;\n formats.altFormat =\n userConfig.noCalendar || timeMode\n ? \"h:i\" + (userConfig.enableSeconds ? \":S K\" : \" K\")\n : defaultAltFormat + (\" h:i\" + (userConfig.enableSeconds ? \":S\" : \"\") + \" K\");\n }\n Object.defineProperty(self.config, \"minDate\", {\n get: function () { return self.config._minDate; },\n set: minMaxDateSetter(\"min\"),\n });\n Object.defineProperty(self.config, \"maxDate\", {\n get: function () { return self.config._maxDate; },\n set: minMaxDateSetter(\"max\"),\n });\n var minMaxTimeSetter = function (type) { return function (val) {\n self.config[type === \"min\" ? \"_minTime\" : \"_maxTime\"] = self.parseDate(val, \"H:i:S\");\n }; };\n Object.defineProperty(self.config, \"minTime\", {\n get: function () { return self.config._minTime; },\n set: minMaxTimeSetter(\"min\"),\n });\n Object.defineProperty(self.config, \"maxTime\", {\n get: function () { return self.config._maxTime; },\n set: minMaxTimeSetter(\"max\"),\n });\n if (userConfig.mode === \"time\") {\n self.config.noCalendar = true;\n self.config.enableTime = true;\n }\n Object.assign(self.config, formats, userConfig);\n for (var i = 0; i < boolOpts.length; i++)\n self.config[boolOpts[i]] =\n self.config[boolOpts[i]] === true ||\n self.config[boolOpts[i]] === \"true\";\n HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) {\n self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance);\n });\n self.isMobile =\n !self.config.disableMobile &&\n !self.config.inline &&\n self.config.mode === \"single\" &&\n !self.config.disable.length &&\n !self.config.enable &&\n !self.config.weekNumbers &&\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n for (var i = 0; i < self.config.plugins.length; i++) {\n var pluginConf = self.config.plugins[i](self) || {};\n for (var key in pluginConf) {\n if (HOOKS.indexOf(key) > -1) {\n self.config[key] = arrayify(pluginConf[key])\n .map(bindToInstance)\n .concat(self.config[key]);\n }\n else if (typeof userConfig[key] === \"undefined\")\n self.config[key] = pluginConf[key];\n }\n }\n if (!userConfig.altInputClass) {\n self.config.altInputClass =\n getInputElem().className + \" \" + self.config.altInputClass;\n }\n triggerEvent(\"onParseConfig\");\n }\n function getInputElem() {\n return self.config.wrap\n ? element.querySelector(\"[data-input]\")\n : element;\n }\n function setupLocale() {\n if (typeof self.config.locale !== \"object\" &&\n typeof flatpickr.l10ns[self.config.locale] === \"undefined\")\n self.config.errorHandler(new Error(\"flatpickr: invalid locale \" + self.config.locale));\n self.l10n = __assign(__assign({}, flatpickr.l10ns.default), (typeof self.config.locale === \"object\"\n ? self.config.locale\n : self.config.locale !== \"default\"\n ? flatpickr.l10ns[self.config.locale]\n : undefined));\n tokenRegex.D = \"(\" + self.l10n.weekdays.shorthand.join(\"|\") + \")\";\n tokenRegex.l = \"(\" + self.l10n.weekdays.longhand.join(\"|\") + \")\";\n tokenRegex.M = \"(\" + self.l10n.months.shorthand.join(\"|\") + \")\";\n tokenRegex.F = \"(\" + self.l10n.months.longhand.join(\"|\") + \")\";\n tokenRegex.K = \"(\" + self.l10n.amPM[0] + \"|\" + self.l10n.amPM[1] + \"|\" + self.l10n.amPM[0].toLowerCase() + \"|\" + self.l10n.amPM[1].toLowerCase() + \")\";\n var userConfig = __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {})));\n if (userConfig.time_24hr === undefined &&\n flatpickr.defaultConfig.time_24hr === undefined) {\n self.config.time_24hr = self.l10n.time_24hr;\n }\n self.formatDate = createDateFormatter(self);\n self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });\n }\n function positionCalendar(customPositionElement) {\n if (typeof self.config.position === \"function\") {\n return void self.config.position(self, customPositionElement);\n }\n if (self.calendarContainer === undefined)\n return;\n triggerEvent(\"onPreCalendarPosition\");\n var positionElement = customPositionElement || self._positionElement;\n var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(\" \"), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === \"above\" ||\n (configPosVertical !== \"below\" &&\n distanceFromBottom < calendarHeight &&\n inputBounds.top > calendarHeight);\n var top = window.pageYOffset +\n inputBounds.top +\n (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);\n toggleClass(self.calendarContainer, \"arrowTop\", !showOnTop);\n toggleClass(self.calendarContainer, \"arrowBottom\", showOnTop);\n if (self.config.inline)\n return;\n var left = window.pageXOffset + inputBounds.left;\n var isCenter = false;\n var isRight = false;\n if (configPosHorizontal === \"center\") {\n left -= (calendarWidth - inputBounds.width) / 2;\n isCenter = true;\n }\n else if (configPosHorizontal === \"right\") {\n left -= calendarWidth - inputBounds.width;\n isRight = true;\n }\n toggleClass(self.calendarContainer, \"arrowLeft\", !isCenter && !isRight);\n toggleClass(self.calendarContainer, \"arrowCenter\", isCenter);\n toggleClass(self.calendarContainer, \"arrowRight\", isRight);\n var right = window.document.body.offsetWidth -\n (window.pageXOffset + inputBounds.right);\n var rightMost = left + calendarWidth > window.document.body.offsetWidth;\n var centerMost = right + calendarWidth > window.document.body.offsetWidth;\n toggleClass(self.calendarContainer, \"rightMost\", rightMost);\n if (self.config.static)\n return;\n self.calendarContainer.style.top = top + \"px\";\n if (!rightMost) {\n self.calendarContainer.style.left = left + \"px\";\n self.calendarContainer.style.right = \"auto\";\n }\n else if (!centerMost) {\n self.calendarContainer.style.left = \"auto\";\n self.calendarContainer.style.right = right + \"px\";\n }\n else {\n var doc = getDocumentStyleSheet();\n if (doc === undefined)\n return;\n var bodyWidth = window.document.body.offsetWidth;\n var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2);\n var centerBefore = \".flatpickr-calendar.centerMost:before\";\n var centerAfter = \".flatpickr-calendar.centerMost:after\";\n var centerIndex = doc.cssRules.length;\n var centerStyle = \"{left:\" + inputBounds.left + \"px;right:auto;}\";\n toggleClass(self.calendarContainer, \"rightMost\", false);\n toggleClass(self.calendarContainer, \"centerMost\", true);\n doc.insertRule(centerBefore + \",\" + centerAfter + centerStyle, centerIndex);\n self.calendarContainer.style.left = centerLeft + \"px\";\n self.calendarContainer.style.right = \"auto\";\n }\n }\n function getDocumentStyleSheet() {\n var editableSheet = null;\n for (var i = 0; i < document.styleSheets.length; i++) {\n var sheet = document.styleSheets[i];\n if (!sheet.cssRules)\n continue;\n try {\n sheet.cssRules;\n }\n catch (err) {\n continue;\n }\n editableSheet = sheet;\n break;\n }\n return editableSheet != null ? editableSheet : createStyleSheet();\n }\n function createStyleSheet() {\n var style = document.createElement(\"style\");\n document.head.appendChild(style);\n return style.sheet;\n }\n function redraw() {\n if (self.config.noCalendar || self.isMobile)\n return;\n buildMonthSwitch();\n updateNavigationCurrentMonth();\n buildDays();\n }\n function focusAndClose() {\n self._input.focus();\n if (window.navigator.userAgent.indexOf(\"MSIE\") !== -1 ||\n navigator.msMaxTouchPoints !== undefined) {\n setTimeout(self.close, 0);\n }\n else {\n self.close();\n }\n }\n function selectDate(e) {\n e.preventDefault();\n e.stopPropagation();\n var isSelectable = function (day) {\n return day.classList &&\n day.classList.contains(\"flatpickr-day\") &&\n !day.classList.contains(\"flatpickr-disabled\") &&\n !day.classList.contains(\"notAllowed\");\n };\n var t = findParent(getEventTarget(e), isSelectable);\n if (t === undefined)\n return;\n var target = t;\n var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime()));\n var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth ||\n selectedDate.getMonth() >\n self.currentMonth + self.config.showMonths - 1) &&\n self.config.mode !== \"range\";\n self.selectedDateElem = target;\n if (self.config.mode === \"single\")\n self.selectedDates = [selectedDate];\n else if (self.config.mode === \"multiple\") {\n var selectedIndex = isDateSelected(selectedDate);\n if (selectedIndex)\n self.selectedDates.splice(parseInt(selectedIndex), 1);\n else\n self.selectedDates.push(selectedDate);\n }\n else if (self.config.mode === \"range\") {\n if (self.selectedDates.length === 2) {\n self.clear(false, false);\n }\n self.latestSelectedDateObj = selectedDate;\n self.selectedDates.push(selectedDate);\n if (compareDates(selectedDate, self.selectedDates[0], true) !== 0)\n self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });\n }\n setHoursFromInputs();\n if (shouldChangeMonth) {\n var isNewYear = self.currentYear !== selectedDate.getFullYear();\n self.currentYear = selectedDate.getFullYear();\n self.currentMonth = selectedDate.getMonth();\n if (isNewYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n triggerEvent(\"onMonthChange\");\n }\n updateNavigationCurrentMonth();\n buildDays();\n updateValue();\n if (!shouldChangeMonth &&\n self.config.mode !== \"range\" &&\n self.config.showMonths === 1)\n focusOnDayElem(target);\n else if (self.selectedDateElem !== undefined &&\n self.hourElement === undefined) {\n self.selectedDateElem && self.selectedDateElem.focus();\n }\n if (self.hourElement !== undefined)\n self.hourElement !== undefined && self.hourElement.focus();\n if (self.config.closeOnSelect) {\n var single = self.config.mode === \"single\" && !self.config.enableTime;\n var range = self.config.mode === \"range\" &&\n self.selectedDates.length === 2 &&\n !self.config.enableTime;\n if (single || range) {\n focusAndClose();\n }\n }\n triggerChange();\n }\n var CALLBACKS = {\n locale: [setupLocale, updateWeekdays],\n showMonths: [buildMonths, setCalendarWidth, buildWeekdays],\n minDate: [jumpToDate],\n maxDate: [jumpToDate],\n positionElement: [updatePositionElement],\n clickOpens: [\n function () {\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n else {\n self._input.removeEventListener(\"focus\", self.open);\n self._input.removeEventListener(\"click\", self.open);\n }\n },\n ],\n };\n function set(option, value) {\n if (option !== null && typeof option === \"object\") {\n Object.assign(self.config, option);\n for (var key in option) {\n if (CALLBACKS[key] !== undefined)\n CALLBACKS[key].forEach(function (x) { return x(); });\n }\n }\n else {\n self.config[option] = value;\n if (CALLBACKS[option] !== undefined)\n CALLBACKS[option].forEach(function (x) { return x(); });\n else if (HOOKS.indexOf(option) > -1)\n self.config[option] = arrayify(value);\n }\n self.redraw();\n updateValue(true);\n }\n function setSelectedDate(inputDate, format) {\n var dates = [];\n if (inputDate instanceof Array)\n dates = inputDate.map(function (d) { return self.parseDate(d, format); });\n else if (inputDate instanceof Date || typeof inputDate === \"number\")\n dates = [self.parseDate(inputDate, format)];\n else if (typeof inputDate === \"string\") {\n switch (self.config.mode) {\n case \"single\":\n case \"time\":\n dates = [self.parseDate(inputDate, format)];\n break;\n case \"multiple\":\n dates = inputDate\n .split(self.config.conjunction)\n .map(function (date) { return self.parseDate(date, format); });\n break;\n case \"range\":\n dates = inputDate\n .split(self.l10n.rangeSeparator)\n .map(function (date) { return self.parseDate(date, format); });\n break;\n default:\n break;\n }\n }\n else\n self.config.errorHandler(new Error(\"Invalid date supplied: \" + JSON.stringify(inputDate)));\n self.selectedDates = (self.config.allowInvalidPreload\n ? dates\n : dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); }));\n if (self.config.mode === \"range\")\n self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });\n }\n function setDate(date, triggerChange, format) {\n if (triggerChange === void 0) { triggerChange = false; }\n if (format === void 0) { format = self.config.dateFormat; }\n if ((date !== 0 && !date) || (date instanceof Array && date.length === 0))\n return self.clear(triggerChange);\n setSelectedDate(date, format);\n self.latestSelectedDateObj =\n self.selectedDates[self.selectedDates.length - 1];\n self.redraw();\n jumpToDate(undefined, triggerChange);\n setHoursFromDate();\n if (self.selectedDates.length === 0) {\n self.clear(false);\n }\n updateValue(triggerChange);\n if (triggerChange)\n triggerEvent(\"onChange\");\n }\n function parseDateRules(arr) {\n return arr\n .slice()\n .map(function (rule) {\n if (typeof rule === \"string\" ||\n typeof rule === \"number\" ||\n rule instanceof Date) {\n return self.parseDate(rule, undefined, true);\n }\n else if (rule &&\n typeof rule === \"object\" &&\n rule.from &&\n rule.to)\n return {\n from: self.parseDate(rule.from, undefined),\n to: self.parseDate(rule.to, undefined),\n };\n return rule;\n })\n .filter(function (x) { return x; });\n }\n function setupDates() {\n self.selectedDates = [];\n self.now = self.parseDate(self.config.now) || new Date();\n var preloadedDate = self.config.defaultDate ||\n ((self.input.nodeName === \"INPUT\" ||\n self.input.nodeName === \"TEXTAREA\") &&\n self.input.placeholder &&\n self.input.value === self.input.placeholder\n ? null\n : self.input.value);\n if (preloadedDate)\n setSelectedDate(preloadedDate, self.config.dateFormat);\n self._initialDate =\n self.selectedDates.length > 0\n ? self.selectedDates[0]\n : self.config.minDate &&\n self.config.minDate.getTime() > self.now.getTime()\n ? self.config.minDate\n : self.config.maxDate &&\n self.config.maxDate.getTime() < self.now.getTime()\n ? self.config.maxDate\n : self.now;\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n if (self.selectedDates.length > 0)\n self.latestSelectedDateObj = self.selectedDates[0];\n if (self.config.minTime !== undefined)\n self.config.minTime = self.parseDate(self.config.minTime, \"H:i\");\n if (self.config.maxTime !== undefined)\n self.config.maxTime = self.parseDate(self.config.maxTime, \"H:i\");\n self.minDateHasTime =\n !!self.config.minDate &&\n (self.config.minDate.getHours() > 0 ||\n self.config.minDate.getMinutes() > 0 ||\n self.config.minDate.getSeconds() > 0);\n self.maxDateHasTime =\n !!self.config.maxDate &&\n (self.config.maxDate.getHours() > 0 ||\n self.config.maxDate.getMinutes() > 0 ||\n self.config.maxDate.getSeconds() > 0);\n }\n function setupInputs() {\n self.input = getInputElem();\n if (!self.input) {\n self.config.errorHandler(new Error(\"Invalid input element specified\"));\n return;\n }\n self.input._type = self.input.type;\n self.input.type = \"text\";\n self.input.classList.add(\"flatpickr-input\");\n self._input = self.input;\n if (self.config.altInput) {\n self.altInput = createElement(self.input.nodeName, self.config.altInputClass);\n self._input = self.altInput;\n self.altInput.placeholder = self.input.placeholder;\n self.altInput.disabled = self.input.disabled;\n self.altInput.required = self.input.required;\n self.altInput.tabIndex = self.input.tabIndex;\n self.altInput.type = \"text\";\n self.input.setAttribute(\"type\", \"hidden\");\n if (!self.config.static && self.input.parentNode)\n self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);\n }\n if (!self.config.allowInput)\n self._input.setAttribute(\"readonly\", \"readonly\");\n updatePositionElement();\n }\n function updatePositionElement() {\n self._positionElement = self.config.positionElement || self._input;\n }\n function setupMobile() {\n var inputType = self.config.enableTime\n ? self.config.noCalendar\n ? \"time\"\n : \"datetime-local\"\n : \"date\";\n self.mobileInput = createElement(\"input\", self.input.className + \" flatpickr-mobile\");\n self.mobileInput.tabIndex = 1;\n self.mobileInput.type = inputType;\n self.mobileInput.disabled = self.input.disabled;\n self.mobileInput.required = self.input.required;\n self.mobileInput.placeholder = self.input.placeholder;\n self.mobileFormatStr =\n inputType === \"datetime-local\"\n ? \"Y-m-d\\\\TH:i:S\"\n : inputType === \"date\"\n ? \"Y-m-d\"\n : \"H:i:S\";\n if (self.selectedDates.length > 0) {\n self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);\n }\n if (self.config.minDate)\n self.mobileInput.min = self.formatDate(self.config.minDate, \"Y-m-d\");\n if (self.config.maxDate)\n self.mobileInput.max = self.formatDate(self.config.maxDate, \"Y-m-d\");\n if (self.input.getAttribute(\"step\"))\n self.mobileInput.step = String(self.input.getAttribute(\"step\"));\n self.input.type = \"hidden\";\n if (self.altInput !== undefined)\n self.altInput.type = \"hidden\";\n try {\n if (self.input.parentNode)\n self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);\n }\n catch (_a) { }\n bind(self.mobileInput, \"change\", function (e) {\n self.setDate(getEventTarget(e).value, false, self.mobileFormatStr);\n triggerEvent(\"onChange\");\n triggerEvent(\"onClose\");\n });\n }\n function toggle(e) {\n if (self.isOpen === true)\n return self.close();\n self.open(e);\n }\n function triggerEvent(event, data) {\n if (self.config === undefined)\n return;\n var hooks = self.config[event];\n if (hooks !== undefined && hooks.length > 0) {\n for (var i = 0; hooks[i] && i < hooks.length; i++)\n hooks[i](self.selectedDates, self.input.value, self, data);\n }\n if (event === \"onChange\") {\n self.input.dispatchEvent(createEvent(\"change\"));\n self.input.dispatchEvent(createEvent(\"input\"));\n }\n }\n function createEvent(name) {\n var e = document.createEvent(\"Event\");\n e.initEvent(name, true, true);\n return e;\n }\n function isDateSelected(date) {\n for (var i = 0; i < self.selectedDates.length; i++) {\n var selectedDate = self.selectedDates[i];\n if (selectedDate instanceof Date &&\n compareDates(selectedDate, date) === 0)\n return \"\" + i;\n }\n return false;\n }\n function isDateInRange(date) {\n if (self.config.mode !== \"range\" || self.selectedDates.length < 2)\n return false;\n return (compareDates(date, self.selectedDates[0]) >= 0 &&\n compareDates(date, self.selectedDates[1]) <= 0);\n }\n function updateNavigationCurrentMonth() {\n if (self.config.noCalendar || self.isMobile || !self.monthNav)\n return;\n self.yearElements.forEach(function (yearElement, i) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType === \"static\") {\n self.monthElements[i].textContent =\n monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + \" \";\n }\n else {\n self.monthsDropdownContainer.value = d.getMonth().toString();\n }\n yearElement.value = d.getFullYear().toString();\n });\n self._hidePrevMonthArrow =\n self.config.minDate !== undefined &&\n (self.currentYear === self.config.minDate.getFullYear()\n ? self.currentMonth <= self.config.minDate.getMonth()\n : self.currentYear < self.config.minDate.getFullYear());\n self._hideNextMonthArrow =\n self.config.maxDate !== undefined &&\n (self.currentYear === self.config.maxDate.getFullYear()\n ? self.currentMonth + 1 > self.config.maxDate.getMonth()\n : self.currentYear > self.config.maxDate.getFullYear());\n }\n function getDateStr(specificFormat) {\n var format = specificFormat ||\n (self.config.altInput ? self.config.altFormat : self.config.dateFormat);\n return self.selectedDates\n .map(function (dObj) { return self.formatDate(dObj, format); })\n .filter(function (d, i, arr) {\n return self.config.mode !== \"range\" ||\n self.config.enableTime ||\n arr.indexOf(d) === i;\n })\n .join(self.config.mode !== \"range\"\n ? self.config.conjunction\n : self.l10n.rangeSeparator);\n }\n function updateValue(triggerChange) {\n if (triggerChange === void 0) { triggerChange = true; }\n if (self.mobileInput !== undefined && self.mobileFormatStr) {\n self.mobileInput.value =\n self.latestSelectedDateObj !== undefined\n ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr)\n : \"\";\n }\n self.input.value = getDateStr(self.config.dateFormat);\n if (self.altInput !== undefined) {\n self.altInput.value = getDateStr(self.config.altFormat);\n }\n if (triggerChange !== false)\n triggerEvent(\"onValueUpdate\");\n }\n function onMonthNavClick(e) {\n var eventTarget = getEventTarget(e);\n var isPrevMonth = self.prevMonthNav.contains(eventTarget);\n var isNextMonth = self.nextMonthNav.contains(eventTarget);\n if (isPrevMonth || isNextMonth) {\n changeMonth(isPrevMonth ? -1 : 1);\n }\n else if (self.yearElements.indexOf(eventTarget) >= 0) {\n eventTarget.select();\n }\n else if (eventTarget.classList.contains(\"arrowUp\")) {\n self.changeYear(self.currentYear + 1);\n }\n else if (eventTarget.classList.contains(\"arrowDown\")) {\n self.changeYear(self.currentYear - 1);\n }\n }\n function timeWrapper(e) {\n e.preventDefault();\n var isKeyDown = e.type === \"keydown\", eventTarget = getEventTarget(e), input = eventTarget;\n if (self.amPM !== undefined && eventTarget === self.amPM) {\n self.amPM.textContent =\n self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n var min = parseFloat(input.getAttribute(\"min\")), max = parseFloat(input.getAttribute(\"max\")), step = parseFloat(input.getAttribute(\"step\")), curValue = parseInt(input.value, 10), delta = e.delta ||\n (isKeyDown ? (e.which === 38 ? 1 : -1) : 0);\n var newValue = curValue + step * delta;\n if (typeof input.value !== \"undefined\" && input.value.length === 2) {\n var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement;\n if (newValue < min) {\n newValue =\n max +\n newValue +\n int(!isHourElem) +\n (int(isHourElem) && int(!self.amPM));\n if (isMinuteElem)\n incrementNumInput(undefined, -1, self.hourElement);\n }\n else if (newValue > max) {\n newValue =\n input === self.hourElement ? newValue - max - int(!self.amPM) : min;\n if (isMinuteElem)\n incrementNumInput(undefined, 1, self.hourElement);\n }\n if (self.amPM &&\n isHourElem &&\n (step === 1\n ? newValue + curValue === 23\n : Math.abs(newValue - curValue) > step)) {\n self.amPM.textContent =\n self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n input.value = pad(newValue);\n }\n }\n init();\n return self;\n}\nfunction _flatpickr(nodeList, config) {\n var nodes = Array.prototype.slice\n .call(nodeList)\n .filter(function (x) { return x instanceof HTMLElement; });\n var instances = [];\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n try {\n if (node.getAttribute(\"data-fp-omit\") !== null)\n continue;\n if (node._flatpickr !== undefined) {\n node._flatpickr.destroy();\n node._flatpickr = undefined;\n }\n node._flatpickr = FlatpickrInstance(node, config || {});\n instances.push(node._flatpickr);\n }\n catch (e) {\n console.error(e);\n }\n }\n return instances.length === 1 ? instances[0] : instances;\n}\nif (typeof HTMLElement !== \"undefined\" &&\n typeof HTMLCollection !== \"undefined\" &&\n typeof NodeList !== \"undefined\") {\n HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n HTMLElement.prototype.flatpickr = function (config) {\n return _flatpickr([this], config);\n };\n}\nvar flatpickr = function (selector, config) {\n if (typeof selector === \"string\") {\n return _flatpickr(window.document.querySelectorAll(selector), config);\n }\n else if (selector instanceof Node) {\n return _flatpickr([selector], config);\n }\n else {\n return _flatpickr(selector, config);\n }\n};\nflatpickr.defaultConfig = {};\nflatpickr.l10ns = {\n en: __assign({}, English),\n default: __assign({}, English),\n};\nflatpickr.localize = function (l10n) {\n flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n);\n};\nflatpickr.setDefaults = function (config) {\n flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config);\n};\nflatpickr.parseDate = createDateParser({});\nflatpickr.formatDate = createDateFormatter({});\nflatpickr.compareDates = compareDates;\nif (typeof jQuery !== \"undefined\" && typeof jQuery.fn !== \"undefined\") {\n jQuery.fn.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n}\nDate.prototype.fp_incr = function (days) {\n return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === \"string\" ? parseInt(days, 10) : days));\n};\nif (typeof window !== \"undefined\") {\n window.flatpickr = flatpickr;\n}\nexport default flatpickr;\n", "/*\nStimulus 3.0.0\nCopyright © 2021 Basecamp, LLC\n */\nclass EventListener {\n constructor(eventTarget, eventName, eventOptions) {\n this.eventTarget = eventTarget;\n this.eventName = eventName;\n this.eventOptions = eventOptions;\n this.unorderedBindings = new Set();\n }\n connect() {\n this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n }\n disconnect() {\n this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n }\n bindingConnected(binding) {\n this.unorderedBindings.add(binding);\n }\n bindingDisconnected(binding) {\n this.unorderedBindings.delete(binding);\n }\n handleEvent(event) {\n const extendedEvent = extendEvent(event);\n for (const binding of this.bindings) {\n if (extendedEvent.immediatePropagationStopped) {\n break;\n }\n else {\n binding.handleEvent(extendedEvent);\n }\n }\n }\n get bindings() {\n return Array.from(this.unorderedBindings).sort((left, right) => {\n const leftIndex = left.index, rightIndex = right.index;\n return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n });\n }\n}\nfunction extendEvent(event) {\n if (\"immediatePropagationStopped\" in event) {\n return event;\n }\n else {\n const { stopImmediatePropagation } = event;\n return Object.assign(event, {\n immediatePropagationStopped: false,\n stopImmediatePropagation() {\n this.immediatePropagationStopped = true;\n stopImmediatePropagation.call(this);\n }\n });\n }\n}\n\nclass Dispatcher {\n constructor(application) {\n this.application = application;\n this.eventListenerMaps = new Map;\n this.started = false;\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.eventListeners.forEach(eventListener => eventListener.connect());\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n this.eventListeners.forEach(eventListener => eventListener.disconnect());\n }\n }\n get eventListeners() {\n return Array.from(this.eventListenerMaps.values())\n .reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n }\n bindingConnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n }\n bindingDisconnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n }\n handleError(error, message, detail = {}) {\n this.application.handleError(error, `Error ${message}`, detail);\n }\n fetchEventListenerForBinding(binding) {\n const { eventTarget, eventName, eventOptions } = binding;\n return this.fetchEventListener(eventTarget, eventName, eventOptions);\n }\n fetchEventListener(eventTarget, eventName, eventOptions) {\n const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n const cacheKey = this.cacheKey(eventName, eventOptions);\n let eventListener = eventListenerMap.get(cacheKey);\n if (!eventListener) {\n eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n eventListenerMap.set(cacheKey, eventListener);\n }\n return eventListener;\n }\n createEventListener(eventTarget, eventName, eventOptions) {\n const eventListener = new EventListener(eventTarget, eventName, eventOptions);\n if (this.started) {\n eventListener.connect();\n }\n return eventListener;\n }\n fetchEventListenerMapForEventTarget(eventTarget) {\n let eventListenerMap = this.eventListenerMaps.get(eventTarget);\n if (!eventListenerMap) {\n eventListenerMap = new Map;\n this.eventListenerMaps.set(eventTarget, eventListenerMap);\n }\n return eventListenerMap;\n }\n cacheKey(eventName, eventOptions) {\n const parts = [eventName];\n Object.keys(eventOptions).sort().forEach(key => {\n parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n });\n return parts.join(\":\");\n }\n}\n\nconst descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n const source = descriptorString.trim();\n const matches = source.match(descriptorPattern) || [];\n return {\n eventTarget: parseEventTarget(matches[4]),\n eventName: matches[2],\n eventOptions: matches[9] ? parseEventOptions(matches[9]) : {},\n identifier: matches[5],\n methodName: matches[7]\n };\n}\nfunction parseEventTarget(eventTargetName) {\n if (eventTargetName == \"window\") {\n return window;\n }\n else if (eventTargetName == \"document\") {\n return document;\n }\n}\nfunction parseEventOptions(eventOptions) {\n return eventOptions.split(\":\").reduce((options, token) => Object.assign(options, { [token.replace(/^!/, \"\")]: !/^!/.test(token) }), {});\n}\nfunction stringifyEventTarget(eventTarget) {\n if (eventTarget == window) {\n return \"window\";\n }\n else if (eventTarget == document) {\n return \"document\";\n }\n}\n\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\nfunction capitalize(value) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\nfunction tokenize(value) {\n return value.match(/[^\\s]+/g) || [];\n}\n\nclass Action {\n constructor(element, index, descriptor) {\n this.element = element;\n this.index = index;\n this.eventTarget = descriptor.eventTarget || element;\n this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n this.eventOptions = descriptor.eventOptions || {};\n this.identifier = descriptor.identifier || error(\"missing identifier\");\n this.methodName = descriptor.methodName || error(\"missing method name\");\n }\n static forToken(token) {\n return new this(token.element, token.index, parseActionDescriptorString(token.content));\n }\n toString() {\n const eventNameSuffix = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n return `${this.eventName}${eventNameSuffix}->${this.identifier}#${this.methodName}`;\n }\n get params() {\n if (this.eventTarget instanceof Element) {\n return this.getParamsFromEventTargetAttributes(this.eventTarget);\n }\n else {\n return {};\n }\n }\n getParamsFromEventTargetAttributes(eventTarget) {\n const params = {};\n const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`);\n const attributes = Array.from(eventTarget.attributes);\n attributes.forEach(({ name, value }) => {\n const match = name.match(pattern);\n const key = match && match[1];\n if (key) {\n Object.assign(params, { [camelize(key)]: typecast(value) });\n }\n });\n return params;\n }\n get eventTargetName() {\n return stringifyEventTarget(this.eventTarget);\n }\n}\nconst defaultEventNames = {\n \"a\": e => \"click\",\n \"button\": e => \"click\",\n \"form\": e => \"submit\",\n \"input\": e => e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\",\n \"select\": e => \"change\",\n \"textarea\": e => \"input\"\n};\nfunction getDefaultEventNameForElement(element) {\n const tagName = element.tagName.toLowerCase();\n if (tagName in defaultEventNames) {\n return defaultEventNames[tagName](element);\n }\n}\nfunction error(message) {\n throw new Error(message);\n}\nfunction typecast(value) {\n try {\n return JSON.parse(value);\n }\n catch (o_O) {\n return value;\n }\n}\n\nclass Binding {\n constructor(context, action) {\n this.context = context;\n this.action = action;\n }\n get index() {\n return this.action.index;\n }\n get eventTarget() {\n return this.action.eventTarget;\n }\n get eventOptions() {\n return this.action.eventOptions;\n }\n get identifier() {\n return this.context.identifier;\n }\n handleEvent(event) {\n if (this.willBeInvokedByEvent(event)) {\n this.invokeWithEvent(event);\n }\n }\n get eventName() {\n return this.action.eventName;\n }\n get method() {\n const method = this.controller[this.methodName];\n if (typeof method == \"function\") {\n return method;\n }\n throw new Error(`Action \"${this.action}\" references undefined method \"${this.methodName}\"`);\n }\n invokeWithEvent(event) {\n const { target, currentTarget } = event;\n try {\n const { params } = this.action;\n const actionEvent = Object.assign(event, { params });\n this.method.call(this.controller, actionEvent);\n this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName });\n }\n catch (error) {\n const { identifier, controller, element, index } = this;\n const detail = { identifier, controller, element, index, event };\n this.context.handleError(error, `invoking action \"${this.action}\"`, detail);\n }\n }\n willBeInvokedByEvent(event) {\n const eventTarget = event.target;\n if (this.element === eventTarget) {\n return true;\n }\n else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n return this.scope.containsElement(eventTarget);\n }\n else {\n return this.scope.containsElement(this.action.element);\n }\n }\n get controller() {\n return this.context.controller;\n }\n get methodName() {\n return this.action.methodName;\n }\n get element() {\n return this.scope.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nclass ElementObserver {\n constructor(element, delegate) {\n this.element = element;\n this.started = false;\n this.delegate = delegate;\n this.elements = new Set;\n this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, { attributes: true, childList: true, subtree: true });\n this.refresh();\n }\n }\n stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n const matches = new Set(this.matchElementsInTree());\n for (const element of Array.from(this.elements)) {\n if (!matches.has(element)) {\n this.removeElement(element);\n }\n }\n for (const element of Array.from(matches)) {\n this.addElement(element);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n if (mutation.type == \"attributes\") {\n this.processAttributeChange(mutation.target, mutation.attributeName);\n }\n else if (mutation.type == \"childList\") {\n this.processRemovedNodes(mutation.removedNodes);\n this.processAddedNodes(mutation.addedNodes);\n }\n }\n processAttributeChange(node, attributeName) {\n const element = node;\n if (this.elements.has(element)) {\n if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n this.delegate.elementAttributeChanged(element, attributeName);\n }\n else {\n this.removeElement(element);\n }\n }\n else if (this.matchElement(element)) {\n this.addElement(element);\n }\n }\n processRemovedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element) {\n this.processTree(element, this.removeElement);\n }\n }\n }\n processAddedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element && this.elementIsActive(element)) {\n this.processTree(element, this.addElement);\n }\n }\n }\n matchElement(element) {\n return this.delegate.matchElement(element);\n }\n matchElementsInTree(tree = this.element) {\n return this.delegate.matchElementsInTree(tree);\n }\n processTree(tree, processor) {\n for (const element of this.matchElementsInTree(tree)) {\n processor.call(this, element);\n }\n }\n elementFromNode(node) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n return node;\n }\n }\n elementIsActive(element) {\n if (element.isConnected != this.element.isConnected) {\n return false;\n }\n else {\n return this.element.contains(element);\n }\n }\n addElement(element) {\n if (!this.elements.has(element)) {\n if (this.elementIsActive(element)) {\n this.elements.add(element);\n if (this.delegate.elementMatched) {\n this.delegate.elementMatched(element);\n }\n }\n }\n }\n removeElement(element) {\n if (this.elements.has(element)) {\n this.elements.delete(element);\n if (this.delegate.elementUnmatched) {\n this.delegate.elementUnmatched(element);\n }\n }\n }\n}\n\nclass AttributeObserver {\n constructor(element, attributeName, delegate) {\n this.attributeName = attributeName;\n this.delegate = delegate;\n this.elementObserver = new ElementObserver(element, this);\n }\n get element() {\n return this.elementObserver.element;\n }\n get selector() {\n return `[${this.attributeName}]`;\n }\n start() {\n this.elementObserver.start();\n }\n stop() {\n this.elementObserver.stop();\n }\n refresh() {\n this.elementObserver.refresh();\n }\n get started() {\n return this.elementObserver.started;\n }\n matchElement(element) {\n return element.hasAttribute(this.attributeName);\n }\n matchElementsInTree(tree) {\n const match = this.matchElement(tree) ? [tree] : [];\n const matches = Array.from(tree.querySelectorAll(this.selector));\n return match.concat(matches);\n }\n elementMatched(element) {\n if (this.delegate.elementMatchedAttribute) {\n this.delegate.elementMatchedAttribute(element, this.attributeName);\n }\n }\n elementUnmatched(element) {\n if (this.delegate.elementUnmatchedAttribute) {\n this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n }\n }\n elementAttributeChanged(element, attributeName) {\n if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n this.delegate.elementAttributeValueChanged(element, attributeName);\n }\n }\n}\n\nclass StringMapObserver {\n constructor(element, delegate) {\n this.element = element;\n this.delegate = delegate;\n this.started = false;\n this.stringMap = new Map;\n this.mutationObserver = new MutationObserver(mutations => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, { attributes: true, attributeOldValue: true });\n this.refresh();\n }\n }\n stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n for (const attributeName of this.knownAttributeNames) {\n this.refreshAttribute(attributeName, null);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n const attributeName = mutation.attributeName;\n if (attributeName) {\n this.refreshAttribute(attributeName, mutation.oldValue);\n }\n }\n refreshAttribute(attributeName, oldValue) {\n const key = this.delegate.getStringMapKeyForAttribute(attributeName);\n if (key != null) {\n if (!this.stringMap.has(attributeName)) {\n this.stringMapKeyAdded(key, attributeName);\n }\n const value = this.element.getAttribute(attributeName);\n if (this.stringMap.get(attributeName) != value) {\n this.stringMapValueChanged(value, key, oldValue);\n }\n if (value == null) {\n const oldValue = this.stringMap.get(attributeName);\n this.stringMap.delete(attributeName);\n if (oldValue)\n this.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n else {\n this.stringMap.set(attributeName, value);\n }\n }\n }\n stringMapKeyAdded(key, attributeName) {\n if (this.delegate.stringMapKeyAdded) {\n this.delegate.stringMapKeyAdded(key, attributeName);\n }\n }\n stringMapValueChanged(value, key, oldValue) {\n if (this.delegate.stringMapValueChanged) {\n this.delegate.stringMapValueChanged(value, key, oldValue);\n }\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n if (this.delegate.stringMapKeyRemoved) {\n this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n }\n get knownAttributeNames() {\n return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n }\n get currentAttributeNames() {\n return Array.from(this.element.attributes).map(attribute => attribute.name);\n }\n get recordedAttributeNames() {\n return Array.from(this.stringMap.keys());\n }\n}\n\nfunction add(map, key, value) {\n fetch(map, key).add(value);\n}\nfunction del(map, key, value) {\n fetch(map, key).delete(value);\n prune(map, key);\n}\nfunction fetch(map, key) {\n let values = map.get(key);\n if (!values) {\n values = new Set();\n map.set(key, values);\n }\n return values;\n}\nfunction prune(map, key) {\n const values = map.get(key);\n if (values != null && values.size == 0) {\n map.delete(key);\n }\n}\n\nclass Multimap {\n constructor() {\n this.valuesByKey = new Map();\n }\n get keys() {\n return Array.from(this.valuesByKey.keys());\n }\n get values() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((values, set) => values.concat(Array.from(set)), []);\n }\n get size() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((size, set) => size + set.size, 0);\n }\n add(key, value) {\n add(this.valuesByKey, key, value);\n }\n delete(key, value) {\n del(this.valuesByKey, key, value);\n }\n has(key, value) {\n const values = this.valuesByKey.get(key);\n return values != null && values.has(value);\n }\n hasKey(key) {\n return this.valuesByKey.has(key);\n }\n hasValue(value) {\n const sets = Array.from(this.valuesByKey.values());\n return sets.some(set => set.has(value));\n }\n getValuesForKey(key) {\n const values = this.valuesByKey.get(key);\n return values ? Array.from(values) : [];\n }\n getKeysForValue(value) {\n return Array.from(this.valuesByKey)\n .filter(([key, values]) => values.has(value))\n .map(([key, values]) => key);\n }\n}\n\nclass IndexedMultimap extends Multimap {\n constructor() {\n super();\n this.keysByValue = new Map;\n }\n get values() {\n return Array.from(this.keysByValue.keys());\n }\n add(key, value) {\n super.add(key, value);\n add(this.keysByValue, value, key);\n }\n delete(key, value) {\n super.delete(key, value);\n del(this.keysByValue, value, key);\n }\n hasValue(value) {\n return this.keysByValue.has(value);\n }\n getKeysForValue(value) {\n const set = this.keysByValue.get(value);\n return set ? Array.from(set) : [];\n }\n}\n\nclass TokenListObserver {\n constructor(element, attributeName, delegate) {\n this.attributeObserver = new AttributeObserver(element, attributeName, this);\n this.delegate = delegate;\n this.tokensByElement = new Multimap;\n }\n get started() {\n return this.attributeObserver.started;\n }\n start() {\n this.attributeObserver.start();\n }\n stop() {\n this.attributeObserver.stop();\n }\n refresh() {\n this.attributeObserver.refresh();\n }\n get element() {\n return this.attributeObserver.element;\n }\n get attributeName() {\n return this.attributeObserver.attributeName;\n }\n elementMatchedAttribute(element) {\n this.tokensMatched(this.readTokensForElement(element));\n }\n elementAttributeValueChanged(element) {\n const [unmatchedTokens, matchedTokens] = this.refreshTokensForElement(element);\n this.tokensUnmatched(unmatchedTokens);\n this.tokensMatched(matchedTokens);\n }\n elementUnmatchedAttribute(element) {\n this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n }\n tokensMatched(tokens) {\n tokens.forEach(token => this.tokenMatched(token));\n }\n tokensUnmatched(tokens) {\n tokens.forEach(token => this.tokenUnmatched(token));\n }\n tokenMatched(token) {\n this.delegate.tokenMatched(token);\n this.tokensByElement.add(token.element, token);\n }\n tokenUnmatched(token) {\n this.delegate.tokenUnmatched(token);\n this.tokensByElement.delete(token.element, token);\n }\n refreshTokensForElement(element) {\n const previousTokens = this.tokensByElement.getValuesForKey(element);\n const currentTokens = this.readTokensForElement(element);\n const firstDifferingIndex = zip(previousTokens, currentTokens)\n .findIndex(([previousToken, currentToken]) => !tokensAreEqual(previousToken, currentToken));\n if (firstDifferingIndex == -1) {\n return [[], []];\n }\n else {\n return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n }\n }\n readTokensForElement(element) {\n const attributeName = this.attributeName;\n const tokenString = element.getAttribute(attributeName) || \"\";\n return parseTokenString(tokenString, element, attributeName);\n }\n}\nfunction parseTokenString(tokenString, element, attributeName) {\n return tokenString.trim().split(/\\s+/).filter(content => content.length)\n .map((content, index) => ({ element, attributeName, content, index }));\n}\nfunction zip(left, right) {\n const length = Math.max(left.length, right.length);\n return Array.from({ length }, (_, index) => [left[index], right[index]]);\n}\nfunction tokensAreEqual(left, right) {\n return left && right && left.index == right.index && left.content == right.content;\n}\n\nclass ValueListObserver {\n constructor(element, attributeName, delegate) {\n this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n this.delegate = delegate;\n this.parseResultsByToken = new WeakMap;\n this.valuesByTokenByElement = new WeakMap;\n }\n get started() {\n return this.tokenListObserver.started;\n }\n start() {\n this.tokenListObserver.start();\n }\n stop() {\n this.tokenListObserver.stop();\n }\n refresh() {\n this.tokenListObserver.refresh();\n }\n get element() {\n return this.tokenListObserver.element;\n }\n get attributeName() {\n return this.tokenListObserver.attributeName;\n }\n tokenMatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).set(token, value);\n this.delegate.elementMatchedValue(element, value);\n }\n }\n tokenUnmatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).delete(token);\n this.delegate.elementUnmatchedValue(element, value);\n }\n }\n fetchParseResultForToken(token) {\n let parseResult = this.parseResultsByToken.get(token);\n if (!parseResult) {\n parseResult = this.parseToken(token);\n this.parseResultsByToken.set(token, parseResult);\n }\n return parseResult;\n }\n fetchValuesByTokenForElement(element) {\n let valuesByToken = this.valuesByTokenByElement.get(element);\n if (!valuesByToken) {\n valuesByToken = new Map;\n this.valuesByTokenByElement.set(element, valuesByToken);\n }\n return valuesByToken;\n }\n parseToken(token) {\n try {\n const value = this.delegate.parseValueForToken(token);\n return { value };\n }\n catch (error) {\n return { error };\n }\n }\n}\n\nclass BindingObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.bindingsByAction = new Map;\n }\n start() {\n if (!this.valueListObserver) {\n this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n this.valueListObserver.start();\n }\n }\n stop() {\n if (this.valueListObserver) {\n this.valueListObserver.stop();\n delete this.valueListObserver;\n this.disconnectAllActions();\n }\n }\n get element() {\n return this.context.element;\n }\n get identifier() {\n return this.context.identifier;\n }\n get actionAttribute() {\n return this.schema.actionAttribute;\n }\n get schema() {\n return this.context.schema;\n }\n get bindings() {\n return Array.from(this.bindingsByAction.values());\n }\n connectAction(action) {\n const binding = new Binding(this.context, action);\n this.bindingsByAction.set(action, binding);\n this.delegate.bindingConnected(binding);\n }\n disconnectAction(action) {\n const binding = this.bindingsByAction.get(action);\n if (binding) {\n this.bindingsByAction.delete(action);\n this.delegate.bindingDisconnected(binding);\n }\n }\n disconnectAllActions() {\n this.bindings.forEach(binding => this.delegate.bindingDisconnected(binding));\n this.bindingsByAction.clear();\n }\n parseValueForToken(token) {\n const action = Action.forToken(token);\n if (action.identifier == this.identifier) {\n return action;\n }\n }\n elementMatchedValue(element, action) {\n this.connectAction(action);\n }\n elementUnmatchedValue(element, action) {\n this.disconnectAction(action);\n }\n}\n\nclass ValueObserver {\n constructor(context, receiver) {\n this.context = context;\n this.receiver = receiver;\n this.stringMapObserver = new StringMapObserver(this.element, this);\n this.valueDescriptorMap = this.controller.valueDescriptorMap;\n this.invokeChangedCallbacksForDefaultValues();\n }\n start() {\n this.stringMapObserver.start();\n }\n stop() {\n this.stringMapObserver.stop();\n }\n get element() {\n return this.context.element;\n }\n get controller() {\n return this.context.controller;\n }\n getStringMapKeyForAttribute(attributeName) {\n if (attributeName in this.valueDescriptorMap) {\n return this.valueDescriptorMap[attributeName].name;\n }\n }\n stringMapKeyAdded(key, attributeName) {\n const descriptor = this.valueDescriptorMap[attributeName];\n if (!this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n }\n }\n stringMapValueChanged(value, name, oldValue) {\n const descriptor = this.valueDescriptorNameMap[name];\n if (value === null)\n return;\n if (oldValue === null) {\n oldValue = descriptor.writer(descriptor.defaultValue);\n }\n this.invokeChangedCallback(name, value, oldValue);\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n const descriptor = this.valueDescriptorNameMap[key];\n if (this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n }\n else {\n this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n }\n }\n invokeChangedCallbacksForDefaultValues() {\n for (const { key, name, defaultValue, writer } of this.valueDescriptors) {\n if (defaultValue != undefined && !this.controller.data.has(key)) {\n this.invokeChangedCallback(name, writer(defaultValue), undefined);\n }\n }\n }\n invokeChangedCallback(name, rawValue, rawOldValue) {\n const changedMethodName = `${name}Changed`;\n const changedMethod = this.receiver[changedMethodName];\n if (typeof changedMethod == \"function\") {\n const descriptor = this.valueDescriptorNameMap[name];\n const value = descriptor.reader(rawValue);\n let oldValue = rawOldValue;\n if (rawOldValue) {\n oldValue = descriptor.reader(rawOldValue);\n }\n changedMethod.call(this.receiver, value, oldValue);\n }\n }\n get valueDescriptors() {\n const { valueDescriptorMap } = this;\n return Object.keys(valueDescriptorMap).map(key => valueDescriptorMap[key]);\n }\n get valueDescriptorNameMap() {\n const descriptors = {};\n Object.keys(this.valueDescriptorMap).forEach(key => {\n const descriptor = this.valueDescriptorMap[key];\n descriptors[descriptor.name] = descriptor;\n });\n return descriptors;\n }\n hasValue(attributeName) {\n const descriptor = this.valueDescriptorNameMap[attributeName];\n const hasMethodName = `has${capitalize(descriptor.name)}`;\n return this.receiver[hasMethodName];\n }\n}\n\nclass TargetObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.targetsByName = new Multimap;\n }\n start() {\n if (!this.tokenListObserver) {\n this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n this.tokenListObserver.start();\n }\n }\n stop() {\n if (this.tokenListObserver) {\n this.disconnectAllTargets();\n this.tokenListObserver.stop();\n delete this.tokenListObserver;\n }\n }\n tokenMatched({ element, content: name }) {\n if (this.scope.containsElement(element)) {\n this.connectTarget(element, name);\n }\n }\n tokenUnmatched({ element, content: name }) {\n this.disconnectTarget(element, name);\n }\n connectTarget(element, name) {\n if (!this.targetsByName.has(name, element)) {\n this.targetsByName.add(name, element);\n this.delegate.targetConnected(element, name);\n }\n }\n disconnectTarget(element, name) {\n if (this.targetsByName.has(name, element)) {\n this.targetsByName.delete(name, element);\n this.delegate.targetDisconnected(element, name);\n }\n }\n disconnectAllTargets() {\n for (const name of this.targetsByName.keys) {\n for (const element of this.targetsByName.getValuesForKey(name)) {\n this.disconnectTarget(element, name);\n }\n }\n }\n get attributeName() {\n return `data-${this.context.identifier}-target`;\n }\n get element() {\n return this.context.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nclass Context {\n constructor(module, scope) {\n this.logDebugActivity = (functionName, detail = {}) => {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.logDebugActivity(this.identifier, functionName, detail);\n };\n this.module = module;\n this.scope = scope;\n this.controller = new module.controllerConstructor(this);\n this.bindingObserver = new BindingObserver(this, this.dispatcher);\n this.valueObserver = new ValueObserver(this, this.controller);\n this.targetObserver = new TargetObserver(this, this);\n try {\n this.controller.initialize();\n this.logDebugActivity(\"initialize\");\n }\n catch (error) {\n this.handleError(error, \"initializing controller\");\n }\n }\n connect() {\n this.bindingObserver.start();\n this.valueObserver.start();\n this.targetObserver.start();\n try {\n this.controller.connect();\n this.logDebugActivity(\"connect\");\n }\n catch (error) {\n this.handleError(error, \"connecting controller\");\n }\n }\n disconnect() {\n try {\n this.controller.disconnect();\n this.logDebugActivity(\"disconnect\");\n }\n catch (error) {\n this.handleError(error, \"disconnecting controller\");\n }\n this.targetObserver.stop();\n this.valueObserver.stop();\n this.bindingObserver.stop();\n }\n get application() {\n return this.module.application;\n }\n get identifier() {\n return this.module.identifier;\n }\n get schema() {\n return this.application.schema;\n }\n get dispatcher() {\n return this.application.dispatcher;\n }\n get element() {\n return this.scope.element;\n }\n get parentElement() {\n return this.element.parentElement;\n }\n handleError(error, message, detail = {}) {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.handleError(error, `Error ${message}`, detail);\n }\n targetConnected(element, name) {\n this.invokeControllerMethod(`${name}TargetConnected`, element);\n }\n targetDisconnected(element, name) {\n this.invokeControllerMethod(`${name}TargetDisconnected`, element);\n }\n invokeControllerMethod(methodName, ...args) {\n const controller = this.controller;\n if (typeof controller[methodName] == \"function\") {\n controller[methodName](...args);\n }\n }\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return Array.from(ancestors.reduce((values, constructor) => {\n getOwnStaticArrayValues(constructor, propertyName).forEach(name => values.add(name));\n return values;\n }, new Set));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return ancestors.reduce((pairs, constructor) => {\n pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n return pairs;\n }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n const ancestors = [];\n while (constructor) {\n ancestors.push(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n const definition = constructor[propertyName];\n return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n const definition = constructor[propertyName];\n return definition ? Object.keys(definition).map(key => [key, definition[key]]) : [];\n}\n\nfunction bless(constructor) {\n return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n const shadowConstructor = extend(constructor);\n const shadowProperties = getShadowProperties(constructor.prototype, properties);\n Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n const blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n return blessings.reduce((blessedProperties, blessing) => {\n const properties = blessing(constructor);\n for (const key in properties) {\n const descriptor = blessedProperties[key] || {};\n blessedProperties[key] = Object.assign(descriptor, properties[key]);\n }\n return blessedProperties;\n }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n return getOwnKeys(properties).reduce((shadowProperties, key) => {\n const descriptor = getShadowedDescriptor(prototype, properties, key);\n if (descriptor) {\n Object.assign(shadowProperties, { [key]: descriptor });\n }\n return shadowProperties;\n }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n const shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n const shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n if (!shadowedByValue) {\n const descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n if (shadowingDescriptor) {\n descriptor.get = shadowingDescriptor.get || descriptor.get;\n descriptor.set = shadowingDescriptor.set || descriptor.set;\n }\n return descriptor;\n }\n}\nconst getOwnKeys = (() => {\n if (typeof Object.getOwnPropertySymbols == \"function\") {\n return (object) => [\n ...Object.getOwnPropertyNames(object),\n ...Object.getOwnPropertySymbols(object)\n ];\n }\n else {\n return Object.getOwnPropertyNames;\n }\n})();\nconst extend = (() => {\n function extendWithReflect(constructor) {\n function extended() {\n return Reflect.construct(constructor, arguments, new.target);\n }\n extended.prototype = Object.create(constructor.prototype, {\n constructor: { value: extended }\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n function testReflectExtension() {\n const a = function () { this.a.call(this); };\n const b = extendWithReflect(a);\n b.prototype.a = function () { };\n return new b;\n }\n try {\n testReflectExtension();\n return extendWithReflect;\n }\n catch (error) {\n return (constructor) => class extended extends constructor {\n };\n }\n})();\n\nfunction blessDefinition(definition) {\n return {\n identifier: definition.identifier,\n controllerConstructor: bless(definition.controllerConstructor)\n };\n}\n\nclass Module {\n constructor(application, definition) {\n this.application = application;\n this.definition = blessDefinition(definition);\n this.contextsByScope = new WeakMap;\n this.connectedContexts = new Set;\n }\n get identifier() {\n return this.definition.identifier;\n }\n get controllerConstructor() {\n return this.definition.controllerConstructor;\n }\n get contexts() {\n return Array.from(this.connectedContexts);\n }\n connectContextForScope(scope) {\n const context = this.fetchContextForScope(scope);\n this.connectedContexts.add(context);\n context.connect();\n }\n disconnectContextForScope(scope) {\n const context = this.contextsByScope.get(scope);\n if (context) {\n this.connectedContexts.delete(context);\n context.disconnect();\n }\n }\n fetchContextForScope(scope) {\n let context = this.contextsByScope.get(scope);\n if (!context) {\n context = new Context(this, scope);\n this.contextsByScope.set(scope, context);\n }\n return context;\n }\n}\n\nclass ClassMap {\n constructor(scope) {\n this.scope = scope;\n }\n has(name) {\n return this.data.has(this.getDataKey(name));\n }\n get(name) {\n return this.getAll(name)[0];\n }\n getAll(name) {\n const tokenString = this.data.get(this.getDataKey(name)) || \"\";\n return tokenize(tokenString);\n }\n getAttributeName(name) {\n return this.data.getAttributeNameForKey(this.getDataKey(name));\n }\n getDataKey(name) {\n return `${name}-class`;\n }\n get data() {\n return this.scope.data;\n }\n}\n\nclass DataMap {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.getAttribute(name);\n }\n set(key, value) {\n const name = this.getAttributeNameForKey(key);\n this.element.setAttribute(name, value);\n return this.get(key);\n }\n has(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.hasAttribute(name);\n }\n delete(key) {\n if (this.has(key)) {\n const name = this.getAttributeNameForKey(key);\n this.element.removeAttribute(name);\n return true;\n }\n else {\n return false;\n }\n }\n getAttributeNameForKey(key) {\n return `data-${this.identifier}-${dasherize(key)}`;\n }\n}\n\nclass Guide {\n constructor(logger) {\n this.warnedKeysByObject = new WeakMap;\n this.logger = logger;\n }\n warn(object, key, message) {\n let warnedKeys = this.warnedKeysByObject.get(object);\n if (!warnedKeys) {\n warnedKeys = new Set;\n this.warnedKeysByObject.set(object, warnedKeys);\n }\n if (!warnedKeys.has(key)) {\n warnedKeys.add(key);\n this.logger.warn(message, object);\n }\n }\n}\n\nfunction attributeValueContainsToken(attributeName, token) {\n return `[${attributeName}~=\"${token}\"]`;\n}\n\nclass TargetSet {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get schema() {\n return this.scope.schema;\n }\n has(targetName) {\n return this.find(targetName) != null;\n }\n find(...targetNames) {\n return targetNames.reduce((target, targetName) => target\n || this.findTarget(targetName)\n || this.findLegacyTarget(targetName), undefined);\n }\n findAll(...targetNames) {\n return targetNames.reduce((targets, targetName) => [\n ...targets,\n ...this.findAllTargets(targetName),\n ...this.findAllLegacyTargets(targetName)\n ], []);\n }\n findTarget(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findElement(selector);\n }\n findAllTargets(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findAllElements(selector);\n }\n getSelectorForTargetName(targetName) {\n const attributeName = this.schema.targetAttributeForScope(this.identifier);\n return attributeValueContainsToken(attributeName, targetName);\n }\n findLegacyTarget(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.deprecate(this.scope.findElement(selector), targetName);\n }\n findAllLegacyTargets(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.scope.findAllElements(selector).map(element => this.deprecate(element, targetName));\n }\n getLegacySelectorForTargetName(targetName) {\n const targetDescriptor = `${this.identifier}.${targetName}`;\n return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n }\n deprecate(element, targetName) {\n if (element) {\n const { identifier } = this;\n const attributeName = this.schema.targetAttribute;\n const revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n this.guide.warn(element, `target:${targetName}`, `Please replace ${attributeName}=\"${identifier}.${targetName}\" with ${revisedAttributeName}=\"${targetName}\". ` +\n `The ${attributeName} attribute is deprecated and will be removed in a future version of Stimulus.`);\n }\n return element;\n }\n get guide() {\n return this.scope.guide;\n }\n}\n\nclass Scope {\n constructor(schema, element, identifier, logger) {\n this.targets = new TargetSet(this);\n this.classes = new ClassMap(this);\n this.data = new DataMap(this);\n this.containsElement = (element) => {\n return element.closest(this.controllerSelector) === this.element;\n };\n this.schema = schema;\n this.element = element;\n this.identifier = identifier;\n this.guide = new Guide(logger);\n }\n findElement(selector) {\n return this.element.matches(selector)\n ? this.element\n : this.queryElements(selector).find(this.containsElement);\n }\n findAllElements(selector) {\n return [\n ...this.element.matches(selector) ? [this.element] : [],\n ...this.queryElements(selector).filter(this.containsElement)\n ];\n }\n queryElements(selector) {\n return Array.from(this.element.querySelectorAll(selector));\n }\n get controllerSelector() {\n return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n }\n}\n\nclass ScopeObserver {\n constructor(element, schema, delegate) {\n this.element = element;\n this.schema = schema;\n this.delegate = delegate;\n this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n this.scopesByIdentifierByElement = new WeakMap;\n this.scopeReferenceCounts = new WeakMap;\n }\n start() {\n this.valueListObserver.start();\n }\n stop() {\n this.valueListObserver.stop();\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n parseValueForToken(token) {\n const { element, content: identifier } = token;\n const scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n let scope = scopesByIdentifier.get(identifier);\n if (!scope) {\n scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n scopesByIdentifier.set(identifier, scope);\n }\n return scope;\n }\n elementMatchedValue(element, value) {\n const referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n this.scopeReferenceCounts.set(value, referenceCount);\n if (referenceCount == 1) {\n this.delegate.scopeConnected(value);\n }\n }\n elementUnmatchedValue(element, value) {\n const referenceCount = this.scopeReferenceCounts.get(value);\n if (referenceCount) {\n this.scopeReferenceCounts.set(value, referenceCount - 1);\n if (referenceCount == 1) {\n this.delegate.scopeDisconnected(value);\n }\n }\n }\n fetchScopesByIdentifierForElement(element) {\n let scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n if (!scopesByIdentifier) {\n scopesByIdentifier = new Map;\n this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n }\n return scopesByIdentifier;\n }\n}\n\nclass Router {\n constructor(application) {\n this.application = application;\n this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n this.scopesByIdentifier = new Multimap;\n this.modulesByIdentifier = new Map;\n }\n get element() {\n return this.application.element;\n }\n get schema() {\n return this.application.schema;\n }\n get logger() {\n return this.application.logger;\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n get modules() {\n return Array.from(this.modulesByIdentifier.values());\n }\n get contexts() {\n return this.modules.reduce((contexts, module) => contexts.concat(module.contexts), []);\n }\n start() {\n this.scopeObserver.start();\n }\n stop() {\n this.scopeObserver.stop();\n }\n loadDefinition(definition) {\n this.unloadIdentifier(definition.identifier);\n const module = new Module(this.application, definition);\n this.connectModule(module);\n }\n unloadIdentifier(identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n this.disconnectModule(module);\n }\n }\n getContextForElementAndIdentifier(element, identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n return module.contexts.find(context => context.element == element);\n }\n }\n handleError(error, message, detail) {\n this.application.handleError(error, message, detail);\n }\n createScopeForElementAndIdentifier(element, identifier) {\n return new Scope(this.schema, element, identifier, this.logger);\n }\n scopeConnected(scope) {\n this.scopesByIdentifier.add(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.connectContextForScope(scope);\n }\n }\n scopeDisconnected(scope) {\n this.scopesByIdentifier.delete(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.disconnectContextForScope(scope);\n }\n }\n connectModule(module) {\n this.modulesByIdentifier.set(module.identifier, module);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(scope => module.connectContextForScope(scope));\n }\n disconnectModule(module) {\n this.modulesByIdentifier.delete(module.identifier);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(scope => module.disconnectContextForScope(scope));\n }\n}\n\nconst defaultSchema = {\n controllerAttribute: \"data-controller\",\n actionAttribute: \"data-action\",\n targetAttribute: \"data-target\",\n targetAttributeForScope: identifier => `data-${identifier}-target`\n};\n\nclass Application {\n constructor(element = document.documentElement, schema = defaultSchema) {\n this.logger = console;\n this.debug = false;\n this.logDebugActivity = (identifier, functionName, detail = {}) => {\n if (this.debug) {\n this.logFormattedMessage(identifier, functionName, detail);\n }\n };\n this.element = element;\n this.schema = schema;\n this.dispatcher = new Dispatcher(this);\n this.router = new Router(this);\n }\n static start(element, schema) {\n const application = new Application(element, schema);\n application.start();\n return application;\n }\n async start() {\n await domReady();\n this.logDebugActivity(\"application\", \"starting\");\n this.dispatcher.start();\n this.router.start();\n this.logDebugActivity(\"application\", \"start\");\n }\n stop() {\n this.logDebugActivity(\"application\", \"stopping\");\n this.dispatcher.stop();\n this.router.stop();\n this.logDebugActivity(\"application\", \"stop\");\n }\n register(identifier, controllerConstructor) {\n if (controllerConstructor.shouldLoad) {\n this.load({ identifier, controllerConstructor });\n }\n }\n load(head, ...rest) {\n const definitions = Array.isArray(head) ? head : [head, ...rest];\n definitions.forEach(definition => this.router.loadDefinition(definition));\n }\n unload(head, ...rest) {\n const identifiers = Array.isArray(head) ? head : [head, ...rest];\n identifiers.forEach(identifier => this.router.unloadIdentifier(identifier));\n }\n get controllers() {\n return this.router.contexts.map(context => context.controller);\n }\n getControllerForElementAndIdentifier(element, identifier) {\n const context = this.router.getContextForElementAndIdentifier(element, identifier);\n return context ? context.controller : null;\n }\n handleError(error, message, detail) {\n var _a;\n this.logger.error(`%s\\n\\n%o\\n\\n%o`, message, error, detail);\n (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n }\n logFormattedMessage(identifier, functionName, detail = {}) {\n detail = Object.assign({ application: this }, detail);\n this.logger.groupCollapsed(`${identifier} #${functionName}`);\n this.logger.log(\"details:\", Object.assign({}, detail));\n this.logger.groupEnd();\n }\n}\nfunction domReady() {\n return new Promise(resolve => {\n if (document.readyState == \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", () => resolve());\n }\n else {\n resolve();\n }\n });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n return classes.reduce((properties, classDefinition) => {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\nfunction propertiesForClassDefinition(key) {\n return {\n [`${key}Class`]: {\n get() {\n const { classes } = this;\n if (classes.has(key)) {\n return classes.get(key);\n }\n else {\n const attribute = classes.getAttributeName(key);\n throw new Error(`Missing attribute \"${attribute}\"`);\n }\n }\n },\n [`${key}Classes`]: {\n get() {\n return this.classes.getAll(key);\n }\n },\n [`has${capitalize(key)}Class`]: {\n get() {\n return this.classes.has(key);\n }\n }\n };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n return targets.reduce((properties, targetDefinition) => {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n return {\n [`${name}Target`]: {\n get() {\n const target = this.targets.find(name);\n if (target) {\n return target;\n }\n else {\n throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n }\n }\n },\n [`${name}Targets`]: {\n get() {\n return this.targets.findAll(name);\n }\n },\n [`has${capitalize(name)}Target`]: {\n get() {\n return this.targets.has(name);\n }\n }\n };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n const propertyDescriptorMap = {\n valueDescriptorMap: {\n get() {\n return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);\n const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n return Object.assign(result, { [attributeName]: valueDescriptor });\n }, {});\n }\n }\n };\n return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair) {\n const definition = parseValueDefinitionPair(valueDefinitionPair);\n const { key, name, reader: read, writer: write } = definition;\n return {\n [name]: {\n get() {\n const value = this.data.get(key);\n if (value !== null) {\n return read(value);\n }\n else {\n return definition.defaultValue;\n }\n },\n set(value) {\n if (value === undefined) {\n this.data.delete(key);\n }\n else {\n this.data.set(key, write(value));\n }\n }\n },\n [`has${capitalize(name)}`]: {\n get() {\n return this.data.has(key) || definition.hasCustomDefaultValue;\n }\n }\n };\n}\nfunction parseValueDefinitionPair([token, typeDefinition]) {\n return valueDescriptorForTokenAndTypeDefinition(token, typeDefinition);\n}\nfunction parseValueTypeConstant(constant) {\n switch (constant) {\n case Array: return \"array\";\n case Boolean: return \"boolean\";\n case Number: return \"number\";\n case Object: return \"object\";\n case String: return \"string\";\n }\n}\nfunction parseValueTypeDefault(defaultValue) {\n switch (typeof defaultValue) {\n case \"boolean\": return \"boolean\";\n case \"number\": return \"number\";\n case \"string\": return \"string\";\n }\n if (Array.isArray(defaultValue))\n return \"array\";\n if (Object.prototype.toString.call(defaultValue) === \"[object Object]\")\n return \"object\";\n}\nfunction parseValueTypeObject(typeObject) {\n const typeFromObject = parseValueTypeConstant(typeObject.type);\n if (typeFromObject) {\n const defaultValueType = parseValueTypeDefault(typeObject.default);\n if (typeFromObject !== defaultValueType) {\n throw new Error(`Type \"${typeFromObject}\" must match the type of the default value. Given default value: \"${typeObject.default}\" as \"${defaultValueType}\"`);\n }\n return typeFromObject;\n }\n}\nfunction parseValueTypeDefinition(typeDefinition) {\n const typeFromObject = parseValueTypeObject(typeDefinition);\n const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n const typeFromConstant = parseValueTypeConstant(typeDefinition);\n const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n if (type)\n return type;\n throw new Error(`Unknown value type \"${typeDefinition}\"`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n const constant = parseValueTypeConstant(typeDefinition);\n if (constant)\n return defaultValuesByType[constant];\n const defaultValue = typeDefinition.default;\n if (defaultValue !== undefined)\n return defaultValue;\n return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(token, typeDefinition) {\n const key = `${dasherize(token)}-value`;\n const type = parseValueTypeDefinition(typeDefinition);\n return {\n type,\n key,\n name: camelize(key),\n get defaultValue() { return defaultValueForDefinition(typeDefinition); },\n get hasCustomDefaultValue() { return parseValueTypeDefault(typeDefinition) !== undefined; },\n reader: readers[type],\n writer: writers[type] || writers.default\n };\n}\nconst defaultValuesByType = {\n get array() { return []; },\n boolean: false,\n number: 0,\n get object() { return {}; },\n string: \"\"\n};\nconst readers = {\n array(value) {\n const array = JSON.parse(value);\n if (!Array.isArray(array)) {\n throw new TypeError(\"Expected array\");\n }\n return array;\n },\n boolean(value) {\n return !(value == \"0\" || value == \"false\");\n },\n number(value) {\n return Number(value);\n },\n object(value) {\n const object = JSON.parse(value);\n if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n throw new TypeError(\"Expected object\");\n }\n return object;\n },\n string(value) {\n return value;\n }\n};\nconst writers = {\n default: writeString,\n array: writeJSON,\n object: writeJSON\n};\nfunction writeJSON(value) {\n return JSON.stringify(value);\n}\nfunction writeString(value) {\n return `${value}`;\n}\n\nclass Controller {\n constructor(context) {\n this.context = context;\n }\n static get shouldLoad() {\n return true;\n }\n get application() {\n return this.context.application;\n }\n get scope() {\n return this.context.scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get targets() {\n return this.scope.targets;\n }\n get classes() {\n return this.scope.classes;\n }\n get data() {\n return this.scope.data;\n }\n initialize() {\n }\n connect() {\n }\n disconnect() {\n }\n dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true } = {}) {\n const type = prefix ? `${prefix}:${eventName}` : eventName;\n const event = new CustomEvent(type, { detail, bubbles, cancelable });\n target.dispatchEvent(event);\n return event;\n }\n}\nController.blessings = [ClassPropertiesBlessing, TargetPropertiesBlessing, ValuePropertiesBlessing];\nController.targets = [];\nController.values = {};\n\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, StringMapObserver, TokenListObserver, ValueListObserver, add, defaultSchema, del, fetch, prune };\n", "export const kebabCase = string =>\n string\n .replace(/([a-z])([A-Z])/g, \"$1-$2\")\n .replace(/[\\s_]+/g, \"-\")\n .toLowerCase();\n\nexport const capitalize = string => {\n return string.charAt(0).toUpperCase() + string.slice(1);\n};\n", "const booleanOptions = [\n 'allowInput',\n 'altInput',\n 'animate',\n 'clickOpens',\n 'closeOnSelect',\n 'disableMobile',\n 'enableSeconds',\n 'enableTime',\n 'inline',\n 'noCalendar',\n 'shorthandCurrentMonth',\n 'static',\n 'time_24hr',\n 'weekNumbers',\n 'wrap'\n]\n\nconst stringOptions = [\n 'altInputClass',\n 'conjunction',\n 'mode',\n 'nextArrow',\n 'position',\n 'prevArrow',\n 'monthSelectorType'\n]\n\nconst numberOptions = [\n 'defaultHour',\n 'defaultMinute',\n 'defaultSeconds',\n 'hourIncrement',\n 'minuteIncrement',\n 'showMonths'\n]\n\nconst arrayOptions = ['disable', 'enable', 'disableDaysOfWeek', 'enableDaysOfWeek']\n\nconst arrayOrStringOptions = ['defaultDate']\n\nconst dateOptions = ['maxDate', 'minDate', 'maxTime', 'minTime', 'now']\n\nexport const dateFormats = ['altFormat', 'ariaDateFormat', 'dateFormat']\n\nexport const options = {\n string: stringOptions,\n boolean: booleanOptions,\n date: dateOptions,\n array: arrayOptions,\n number: numberOptions,\n arrayOrString: arrayOrStringOptions\n}\n", "export const events = ['change', 'open', 'close', 'monthChange', 'yearChange', 'ready', 'valueUpdate', 'dayCreate']\n", "export const elements = [\n 'calendarContainer',\n 'currentYearElement',\n 'days',\n 'daysContainer',\n 'input',\n 'nextMonthNav',\n 'monthNav',\n 'prevMonthNav',\n 'rContainer',\n 'selectedDateElem',\n 'todayDateElem',\n 'weekdayContainer'\n]\n", "export const mapping = {\n '%Y': 'Y',\n '%y': 'y',\n '%C': 'Y',\n '%m': 'm',\n '%-m': 'n',\n '%_m': 'n',\n '%B': 'F',\n '%^B': 'F',\n '%b': 'M',\n '%^b': 'M',\n '%h': 'M',\n '%^h': 'M',\n '%d': 'd',\n '%-d': 'j',\n '%e': 'j',\n '%H': 'H',\n '%k': 'H',\n '%I': 'h',\n '%l': 'h',\n '%-l': 'h',\n '%P': 'K',\n '%p': 'K',\n '%M': 'i',\n '%S': 'S',\n '%A': 'l',\n '%a': 'D',\n '%w': 'w'\n}\n\nconst strftimeRegex = new RegExp(\n Object.keys(mapping)\n .join('|')\n .replace(new RegExp('\\\\^', 'g'), '\\\\^'),\n 'g'\n)\n\nexport const convertDateFormat = (format) => {\n return format.replace(strftimeRegex, (match) => {\n return mapping[match]\n })\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport flatpickr from 'flatpickr'\nimport { kebabCase, capitalize } from './utils'\nimport { options, dateFormats } from './config_options'\nimport { events } from './events'\nimport { elements } from './elements'\nimport { convertDateFormat } from './strftime_mapping'\n\nclass StimulusFlatpickr extends Controller {\n static targets = ['instance']\n\n initialize() {\n this.config = {}\n }\n\n connect() {\n this._initializeEvents()\n this._initializeOptions()\n this._initializeDateFormats()\n\n this.fp = flatpickr(this.flatpickrElement, {\n ...this.config\n })\n\n this._initializeElements()\n }\n\n disconnect() {\n const value = this.inputTarget.value\n this.fp.destroy()\n this.inputTarget.value = value\n }\n\n _initializeEvents() {\n events.forEach((event) => {\n if (this[event]) {\n const hook = `on${capitalize(event)}`\n this.config[hook] = this[event].bind(this)\n }\n })\n }\n\n _initializeOptions() {\n Object.keys(options).forEach((optionType) => {\n const optionsCamelCase = options[optionType]\n optionsCamelCase.forEach((option) => {\n const optionKebab = kebabCase(option)\n if (this.data.has(optionKebab)) {\n this.config[option] = this[`_${optionType}`](optionKebab)\n }\n })\n })\n this._handleDaysOfWeek()\n }\n\n _handleDaysOfWeek() {\n if (this.config.disableDaysOfWeek) {\n this.config.disableDaysOfWeek = this._validateDaysOfWeek(this.config.disableDaysOfWeek)\n this.config.disable = [...(this.config.disable || []), this._disable.bind(this)]\n }\n\n if (this.config.enableDaysOfWeek) {\n this.config.enableDaysOfWeek = this._validateDaysOfWeek(this.config.enableDaysOfWeek)\n this.config.enable = [...(this.config.enable || []), this._enable.bind(this)]\n }\n }\n\n _validateDaysOfWeek(days) {\n if (Array.isArray(days)) {\n return days.map((day) => parseInt(day))\n } else {\n console.error('days of week must be a valid array')\n return []\n }\n }\n\n _disable(date) {\n const disabledDays = this.config.disableDaysOfWeek\n return disabledDays.includes(date.getDay())\n }\n\n _enable(date) {\n const enabledDays = this.config.enableDaysOfWeek\n return enabledDays.includes(date.getDay())\n }\n\n _initializeDateFormats() {\n dateFormats.forEach((dateFormat) => {\n if (this.data.has(dateFormat)) {\n this.config[dateFormat] = convertDateFormat(this.data.get(dateFormat))\n }\n })\n }\n\n _initializeElements() {\n elements.forEach((element) => {\n this[`${element}Target`] = this.fp[element]\n })\n }\n\n _string(option) {\n return this.data.get(option)\n }\n\n _date(option) {\n return this.data.get(option)\n }\n\n _boolean(option) {\n return !(this.data.get(option) == '0' || this.data.get(option) == 'false')\n }\n\n _array(option) {\n return JSON.parse(this.data.get(option))\n }\n\n _number(option) {\n return parseInt(this.data.get(option))\n }\n\n _arrayOrString(option) {\n const val = this.data.get(option)\n try {\n return JSON.parse(val)\n } catch (e) {\n return val\n }\n }\n\n get flatpickrElement() {\n return (this.hasInstanceTarget && this.instanceTarget) || this.element\n }\n}\n\nexport default StimulusFlatpickr\n", "export class FetchResponse {\n constructor (response) {\n this.response = response\n }\n\n get statusCode () {\n return this.response.status\n }\n\n get redirected () {\n return this.response.redirected\n }\n\n get ok () {\n return this.response.ok\n }\n\n get unauthenticated () {\n return this.statusCode === 401\n }\n\n get unprocessableEntity () {\n return this.statusCode === 422\n }\n\n get authenticationURL () {\n return this.response.headers.get('WWW-Authenticate')\n }\n\n get contentType () {\n const contentType = this.response.headers.get('Content-Type') || ''\n\n return contentType.replace(/;.*$/, '')\n }\n\n get headers () {\n return this.response.headers\n }\n\n get html () {\n if (this.contentType.match(/^(application|text)\\/(html|xhtml\\+xml)$/)) {\n return this.text\n }\n\n return Promise.reject(new Error(`Expected an HTML response but got \"${this.contentType}\" instead`))\n }\n\n get json () {\n if (this.contentType.match(/^application\\/.*json$/)) {\n return this.responseJson || (this.responseJson = this.response.json())\n }\n\n return Promise.reject(new Error(`Expected a JSON response but got \"${this.contentType}\" instead`))\n }\n\n get text () {\n return this.responseText || (this.responseText = this.response.text())\n }\n\n get isTurboStream () {\n return this.contentType.match(/^text\\/vnd\\.turbo-stream\\.html/)\n }\n\n async renderTurboStream () {\n if (this.isTurboStream) {\n if (window.Turbo) {\n await window.Turbo.renderStreamMessage(await this.text)\n } else {\n console.warn('You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js')\n }\n } else {\n return Promise.reject(new Error(`Expected a Turbo Stream response but got \"${this.contentType}\" instead`))\n }\n }\n}\n", "export class RequestInterceptor {\n static register (interceptor) {\n this.interceptor = interceptor\n }\n\n static get () {\n return this.interceptor\n }\n\n static reset () {\n this.interceptor = undefined\n }\n}\n", "export function getCookie (name) {\n const cookies = document.cookie ? document.cookie.split('; ') : []\n const prefix = `${encodeURIComponent(name)}=`\n const cookie = cookies.find(cookie => cookie.startsWith(prefix))\n\n if (cookie) {\n const value = cookie.split('=').slice(1).join('=')\n\n if (value) {\n return decodeURIComponent(value)\n }\n }\n}\n\nexport function compact (object) {\n const result = {}\n\n for (const key in object) {\n const value = object[key]\n if (value !== undefined) {\n result[key] = value\n }\n }\n\n return result\n}\n\nexport function metaContent (name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`)\n return element && element.content\n}\n\nexport function stringEntriesFromFormData (formData) {\n return [...formData].reduce((entries, [name, value]) => {\n return entries.concat(typeof value === 'string' ? [[name, value]] : [])\n }, [])\n}\n\nexport function mergeEntries (searchParams, entries) {\n for (const [name, value] of entries) {\n if (value instanceof window.File) continue\n\n if (searchParams.has(name) && !name.includes('[]')) {\n searchParams.delete(name)\n searchParams.set(name, value)\n } else {\n searchParams.append(name, value)\n }\n }\n}\n", "import { FetchResponse } from './fetch_response'\nimport { RequestInterceptor } from './request_interceptor'\nimport { getCookie, compact, metaContent, stringEntriesFromFormData, mergeEntries } from './lib/utils'\n\nexport class FetchRequest {\n constructor (method, url, options = {}) {\n this.method = method\n this.options = options\n this.originalUrl = url.toString()\n }\n\n async perform () {\n try {\n const requestInterceptor = RequestInterceptor.get()\n if (requestInterceptor) {\n await requestInterceptor(this)\n }\n } catch (error) {\n console.error(error)\n }\n\n const response = new FetchResponse(await window.fetch(this.url, this.fetchOptions))\n\n if (response.unauthenticated && response.authenticationURL) {\n return Promise.reject(window.location.href = response.authenticationURL)\n }\n\n const responseStatusIsTurboStreamable = response.ok || response.unprocessableEntity\n\n if (responseStatusIsTurboStreamable && response.isTurboStream) {\n await response.renderTurboStream()\n }\n\n return response\n }\n\n addHeader (key, value) {\n const headers = this.additionalHeaders\n headers[key] = value\n this.options.headers = headers\n }\n\n sameHostname () {\n if (!this.originalUrl.startsWith('http:')) {\n return true\n }\n\n try {\n return new URL(this.originalUrl).hostname === window.location.hostname\n } catch (_) {\n return true\n }\n }\n\n get fetchOptions () {\n return {\n method: this.method.toUpperCase(),\n headers: this.headers,\n body: this.formattedBody,\n signal: this.signal,\n credentials: this.credentials,\n redirect: this.redirect\n }\n }\n\n get headers () {\n const baseHeaders = {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': this.contentType,\n Accept: this.accept\n }\n\n if (this.sameHostname()) {\n baseHeaders['X-CSRF-Token'] = this.csrfToken\n }\n\n return compact(\n Object.assign(baseHeaders, this.additionalHeaders)\n )\n }\n\n get csrfToken () {\n return getCookie(metaContent('csrf-param')) || metaContent('csrf-token')\n }\n\n get contentType () {\n if (this.options.contentType) {\n return this.options.contentType\n } else if (this.body == null || this.body instanceof window.FormData) {\n return undefined\n } else if (this.body instanceof window.File) {\n return this.body.type\n }\n\n return 'application/json'\n }\n\n get accept () {\n switch (this.responseKind) {\n case 'html':\n return 'text/html, application/xhtml+xml'\n case 'turbo-stream':\n return 'text/vnd.turbo-stream.html, text/html, application/xhtml+xml'\n case 'json':\n return 'application/json, application/vnd.api+json'\n default:\n return '*/*'\n }\n }\n\n get body () {\n return this.options.body\n }\n\n get query () {\n const originalQuery = (this.originalUrl.split('?')[1] || '').split('#')[0]\n const params = new URLSearchParams(originalQuery)\n\n let requestQuery = this.options.query\n if (requestQuery instanceof window.FormData) {\n requestQuery = stringEntriesFromFormData(requestQuery)\n } else if (requestQuery instanceof window.URLSearchParams) {\n requestQuery = requestQuery.entries()\n } else {\n requestQuery = Object.entries(requestQuery || {})\n }\n\n mergeEntries(params, requestQuery)\n\n const query = params.toString()\n return (query.length > 0 ? `?${query}` : '')\n }\n\n get url () {\n return (this.originalUrl.split('?')[0]).split('#')[0] + this.query\n }\n\n get responseKind () {\n return this.options.responseKind || 'html'\n }\n\n get signal () {\n return this.options.signal\n }\n\n get redirect () {\n return this.options.redirect || 'follow'\n }\n\n get credentials () {\n return this.options.credentials || 'same-origin'\n }\n\n get additionalHeaders () {\n return this.options.headers || {}\n }\n\n get formattedBody () {\n const bodyIsAString = Object.prototype.toString.call(this.body) === '[object String]'\n const contentTypeIsJson = this.headers['Content-Type'] === 'application/json'\n\n if (contentTypeIsJson && !bodyIsAString) {\n return JSON.stringify(this.body)\n }\n\n return this.body\n }\n}\n", "import { FetchRequest } from './fetch_request'\n\nasync function get (url, options) {\n const request = new FetchRequest('get', url, options)\n return request.perform()\n}\n\nasync function post (url, options) {\n const request = new FetchRequest('post', url, options)\n return request.perform()\n}\n\nasync function put (url, options) {\n const request = new FetchRequest('put', url, options)\n return request.perform()\n}\n\nasync function patch (url, options) {\n const request = new FetchRequest('patch', url, options)\n return request.perform()\n}\n\nasync function destroy (url, options) {\n const request = new FetchRequest('delete', url, options)\n return request.perform()\n}\n\nexport { get, post, put, patch, destroy }\n", "/*\n * stimulus-use 0.52.2\n */\nimport { Controller } from \"@hotwired/stimulus\";\n\nconst method = (controller, methodName) => {\n const method = controller[methodName];\n if (typeof method == \"function\") {\n return method;\n } else {\n return (...args) => {};\n }\n};\n\nconst composeEventName = (name, controller, eventPrefix) => {\n let composedName = name;\n if (eventPrefix === true) {\n composedName = `${controller.identifier}:${name}`;\n } else if (typeof eventPrefix === \"string\") {\n composedName = `${eventPrefix}:${name}`;\n }\n return composedName;\n};\n\nconst extendedEvent = (type, event, detail) => {\n const {bubbles: bubbles, cancelable: cancelable, composed: composed} = event || {\n bubbles: true,\n cancelable: true,\n composed: true\n };\n if (event) {\n Object.assign(detail, {\n originalEvent: event\n });\n }\n const customEvent = new CustomEvent(type, {\n bubbles: bubbles,\n cancelable: cancelable,\n composed: composed,\n detail: detail\n });\n return customEvent;\n};\n\nfunction isElementInViewport(el) {\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n const vertInView = rect.top <= windowHeight && rect.top + rect.height > 0;\n const horInView = rect.left <= windowWidth && rect.left + rect.width > 0;\n return vertInView && horInView;\n}\n\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, ((_, char) => char.toUpperCase()));\n}\n\n/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */ function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nconst defaultOptions$8 = {\n debug: false,\n logger: console,\n dispatchEvent: true,\n eventPrefix: true\n};\n\nclass StimulusUse {\n constructor(controller, options = {}) {\n var _a, _b, _c;\n this.log = (functionName, args) => {\n if (!this.debug) return;\n this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${functionName}`, \"color: #3B82F6\", \"color: unset\");\n this.logger.log(Object.assign({\n controllerId: this.controllerId\n }, args));\n this.logger.groupEnd();\n };\n this.warn = message => {\n this.logger.warn(`%c${this.controller.identifier} %c${message}`, \"color: #3B82F6; font-weight: bold\", \"color: unset\");\n };\n this.dispatch = (eventName, details = {}) => {\n if (this.dispatchEvent) {\n const {event: event} = details, eventDetails = __rest(details, [ \"event\" ]);\n const customEvent = this.extendedEvent(eventName, event || null, eventDetails);\n this.targetElement.dispatchEvent(customEvent);\n this.log(\"dispatchEvent\", Object.assign({\n eventName: customEvent.type\n }, eventDetails));\n }\n };\n this.call = (methodName, args = {}) => {\n const method = this.controller[methodName];\n if (typeof method == \"function\") {\n return method.call(this.controller, args);\n }\n };\n this.extendedEvent = (name, event, detail) => {\n const {bubbles: bubbles, cancelable: cancelable, composed: composed} = event || {\n bubbles: true,\n cancelable: true,\n composed: true\n };\n if (event) {\n Object.assign(detail, {\n originalEvent: event\n });\n }\n const customEvent = new CustomEvent(this.composeEventName(name), {\n bubbles: bubbles,\n cancelable: cancelable,\n composed: composed,\n detail: detail\n });\n return customEvent;\n };\n this.composeEventName = name => {\n let composedName = name;\n if (this.eventPrefix === true) {\n composedName = `${this.controller.identifier}:${name}`;\n } else if (typeof this.eventPrefix === \"string\") {\n composedName = `${this.eventPrefix}:${name}`;\n }\n return composedName;\n };\n this.debug = (_b = (_a = options === null || options === void 0 ? void 0 : options.debug) !== null && _a !== void 0 ? _a : controller.application.stimulusUseDebug) !== null && _b !== void 0 ? _b : defaultOptions$8.debug;\n this.logger = (_c = options === null || options === void 0 ? void 0 : options.logger) !== null && _c !== void 0 ? _c : defaultOptions$8.logger;\n this.controller = controller;\n this.controllerId = controller.element.id || controller.element.dataset.id;\n this.targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n const {dispatchEvent: dispatchEvent, eventPrefix: eventPrefix} = Object.assign({}, defaultOptions$8, options);\n Object.assign(this, {\n dispatchEvent: dispatchEvent,\n eventPrefix: eventPrefix\n });\n this.controllerInitialize = controller.initialize.bind(controller);\n this.controllerConnect = controller.connect.bind(controller);\n this.controllerDisconnect = controller.disconnect.bind(controller);\n }\n}\n\nconst defaultOptions$7 = {\n eventPrefix: true,\n bubbles: true,\n cancelable: true\n};\n\nclass UseDispatch extends StimulusUse {\n constructor(controller, options = {}) {\n var _a, _b, _c, _d;\n super(controller, options);\n this.dispatch = (eventName, detail = {}) => {\n const {controller: controller, targetElement: targetElement, eventPrefix: eventPrefix, bubbles: bubbles, cancelable: cancelable, log: log, warn: warn} = this;\n Object.assign(detail, {\n controller: controller\n });\n const eventNameWithPrefix = composeEventName(eventName, this.controller, eventPrefix);\n const event = new CustomEvent(eventNameWithPrefix, {\n detail: detail,\n bubbles: bubbles,\n cancelable: cancelable\n });\n targetElement.dispatchEvent(event);\n warn(\"`useDispatch()` is deprecated. Please use the built-in `this.dispatch()` function from Stimulus. You can find more information on how to upgrade at: https://stimulus-use.github.io/stimulus-use/#/use-dispatch\");\n log(\"dispatch\", {\n eventName: eventNameWithPrefix,\n detail: detail,\n bubbles: bubbles,\n cancelable: cancelable\n });\n return event;\n };\n this.targetElement = (_a = options.element) !== null && _a !== void 0 ? _a : controller.element;\n this.eventPrefix = (_b = options.eventPrefix) !== null && _b !== void 0 ? _b : defaultOptions$7.eventPrefix;\n this.bubbles = (_c = options.bubbles) !== null && _c !== void 0 ? _c : defaultOptions$7.bubbles;\n this.cancelable = (_d = options.cancelable) !== null && _d !== void 0 ? _d : defaultOptions$7.cancelable;\n this.enhanceController();\n }\n enhanceController() {\n Object.assign(this.controller, {\n dispatch: this.dispatch\n });\n }\n}\n\nconst useDispatch = (controller, options = {}) => new UseDispatch(controller, options);\n\nconst defaultOptions$6 = {\n overwriteDispatch: true\n};\n\nconst useApplication = (controller, options = {}) => {\n const {overwriteDispatch: overwriteDispatch} = Object.assign({}, defaultOptions$6, options);\n Object.defineProperty(controller, \"isPreview\", {\n get() {\n return document.documentElement.hasAttribute(\"data-turbolinks-preview\") || document.documentElement.hasAttribute(\"data-turbo-preview\");\n }\n });\n Object.defineProperty(controller, \"isConnected\", {\n get() {\n return !!Array.from(this.context.module.connectedContexts).find((c => c === this.context));\n }\n });\n Object.defineProperty(controller, \"csrfToken\", {\n get() {\n return this.metaValue(\"csrf-token\");\n }\n });\n if (overwriteDispatch) {\n useDispatch(controller, options);\n }\n Object.assign(controller, {\n metaValue(name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`);\n return element && element.getAttribute(\"content\");\n }\n });\n};\n\nclass ApplicationController extends Controller {\n constructor(context) {\n super(context);\n this.isPreview = false;\n this.isConnected = false;\n this.csrfToken = \"\";\n useApplication(this, this.options);\n }\n}\n\nconst defaultOptions$5 = {\n events: [ \"click\", \"touchend\" ],\n onlyVisible: true,\n dispatchEvent: true,\n eventPrefix: true\n};\n\nconst useClickOutside = (composableController, options = {}) => {\n const controller = composableController;\n const {onlyVisible: onlyVisible, dispatchEvent: dispatchEvent, events: events, eventPrefix: eventPrefix} = Object.assign({}, defaultOptions$5, options);\n const onEvent = event => {\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n if (targetElement.contains(event.target) || !isElementInViewport(targetElement) && onlyVisible) {\n return;\n }\n if (controller.clickOutside) {\n controller.clickOutside(event);\n }\n if (dispatchEvent) {\n const eventName = composeEventName(\"click:outside\", controller, eventPrefix);\n const clickOutsideEvent = extendedEvent(eventName, event, {\n controller: controller\n });\n targetElement.dispatchEvent(clickOutsideEvent);\n }\n };\n const observe = () => {\n events === null || events === void 0 ? void 0 : events.forEach((event => {\n window.addEventListener(event, onEvent, true);\n }));\n };\n const unobserve = () => {\n events === null || events === void 0 ? void 0 : events.forEach((event => {\n window.removeEventListener(event, onEvent, true);\n }));\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass ClickOutsideComposableController extends Controller {}\n\nclass ClickOutsideController extends ClickOutsideComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useClickOutside(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nclass DebounceController extends Controller {}\n\nDebounceController.debounces = [];\n\nconst defaultWait$1 = 200;\n\nconst debounce = (fn, wait = defaultWait$1) => {\n let timeoutId = null;\n return function() {\n const args = Array.from(arguments);\n const context = this;\n const params = args.map((arg => arg.params));\n const callback = () => {\n args.forEach(((arg, index) => arg.params = params[index]));\n return fn.apply(context, args);\n };\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(callback, wait);\n };\n};\n\nconst useDebounce = (composableController, options) => {\n const controller = composableController;\n const constructor = controller.constructor;\n constructor.debounces.forEach((func => {\n if (typeof func === \"string\") {\n controller[func] = debounce(controller[func], options === null || options === void 0 ? void 0 : options.wait);\n }\n if (typeof func === \"object\") {\n const {name: name, wait: wait} = func;\n if (!name) return;\n controller[name] = debounce(controller[name], wait || (options === null || options === void 0 ? void 0 : options.wait));\n }\n }));\n};\n\nclass UseHover extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n this.targetElement.addEventListener(\"mouseenter\", this.onEnter);\n this.targetElement.addEventListener(\"mouseleave\", this.onLeave);\n };\n this.unobserve = () => {\n this.targetElement.removeEventListener(\"mouseenter\", this.onEnter);\n this.targetElement.removeEventListener(\"mouseleave\", this.onLeave);\n };\n this.onEnter = event => {\n this.call(\"mouseEnter\", event);\n this.log(\"mouseEnter\", {\n hover: true\n });\n this.dispatch(\"mouseEnter\", {\n hover: false\n });\n };\n this.onLeave = event => {\n this.call(\"mouseLeave\", event);\n this.log(\"mouseLeave\", {\n hover: false\n });\n this.dispatch(\"mouseLeave\", {\n hover: false\n });\n };\n this.controller = controller;\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useHover = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseHover(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nclass HoverComposableController extends Controller {}\n\nclass HoverController extends HoverComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useHover(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst defaultEvents = [ \"mousemove\", \"mousedown\", \"resize\", \"keydown\", \"touchstart\", \"wheel\" ];\n\nconst oneMinute = 6e4;\n\nconst defaultOptions$4 = {\n ms: oneMinute,\n initialState: false,\n events: defaultEvents,\n dispatchEvent: true,\n eventPrefix: true\n};\n\nconst useIdle = (composableController, options = {}) => {\n const controller = composableController;\n const {ms: ms, initialState: initialState, events: events, dispatchEvent: dispatchEvent, eventPrefix: eventPrefix} = Object.assign({}, defaultOptions$4, options);\n let isIdle = initialState;\n let timeout = setTimeout((() => {\n isIdle = true;\n dispatchAway();\n }), ms);\n const dispatchAway = event => {\n const eventName = composeEventName(\"away\", controller, eventPrefix);\n controller.isIdle = true;\n method(controller, \"away\").call(controller, event);\n if (dispatchEvent) {\n const clickOutsideEvent = extendedEvent(eventName, event || null, {\n controller: controller\n });\n controller.element.dispatchEvent(clickOutsideEvent);\n }\n };\n const dispatchBack = event => {\n const eventName = composeEventName(\"back\", controller, eventPrefix);\n controller.isIdle = false;\n method(controller, \"back\").call(controller, event);\n if (dispatchEvent) {\n const clickOutsideEvent = extendedEvent(eventName, event || null, {\n controller: controller\n });\n controller.element.dispatchEvent(clickOutsideEvent);\n }\n };\n const onEvent = event => {\n if (isIdle) dispatchBack(event);\n isIdle = false;\n clearTimeout(timeout);\n timeout = setTimeout((() => {\n isIdle = true;\n dispatchAway(event);\n }), ms);\n };\n const onVisibility = event => {\n if (!document.hidden) onEvent(event);\n };\n if (isIdle) {\n dispatchAway();\n } else {\n dispatchBack();\n }\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observe = () => {\n events.forEach((event => {\n window.addEventListener(event, onEvent);\n }));\n document.addEventListener(\"visibilitychange\", onVisibility);\n };\n const unobserve = () => {\n clearTimeout(timeout);\n events.forEach((event => {\n window.removeEventListener(event, onEvent);\n }));\n document.removeEventListener(\"visibilitychange\", onVisibility);\n };\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass IdleComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.isIdle = false;\n }\n}\n\nclass IdleController extends IdleComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useIdle(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst defaultOptions$3 = {\n dispatchEvent: true,\n eventPrefix: true,\n visibleAttribute: \"isVisible\"\n};\n\nconst useIntersection = (composableController, options = {}) => {\n const controller = composableController;\n const {dispatchEvent: dispatchEvent, eventPrefix: eventPrefix, visibleAttribute: visibleAttribute} = Object.assign({}, defaultOptions$3, options);\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n if (!controller.intersectionElements) controller.intersectionElements = [];\n controller.intersectionElements.push(targetElement);\n const callback = entries => {\n const [entry] = entries;\n if (entry.isIntersecting) {\n dispatchAppear(entry);\n } else if (targetElement.hasAttribute(visibleAttribute)) {\n dispatchDisappear(entry);\n }\n };\n const observer = new IntersectionObserver(callback, options);\n const dispatchAppear = entry => {\n targetElement.setAttribute(visibleAttribute, \"true\");\n method(controller, \"appear\").call(controller, entry, observer);\n if (dispatchEvent) {\n const eventName = composeEventName(\"appear\", controller, eventPrefix);\n const appearEvent = extendedEvent(eventName, null, {\n controller: controller,\n entry: entry,\n observer: observer\n });\n targetElement.dispatchEvent(appearEvent);\n }\n };\n const dispatchDisappear = entry => {\n targetElement.removeAttribute(visibleAttribute);\n method(controller, \"disappear\").call(controller, entry, observer);\n if (dispatchEvent) {\n const eventName = composeEventName(\"disappear\", controller, eventPrefix);\n const disappearEvent = extendedEvent(eventName, null, {\n controller: controller,\n entry: entry,\n observer: observer\n });\n targetElement.dispatchEvent(disappearEvent);\n }\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const disconnect = () => {\n unobserve();\n controllerDisconnect();\n };\n const observe = () => {\n observer.observe(targetElement);\n };\n const unobserve = () => {\n observer.unobserve(targetElement);\n };\n const noneVisible = () => controller.intersectionElements.filter((element => element.hasAttribute(visibleAttribute))).length === 0;\n const oneVisible = () => controller.intersectionElements.filter((element => element.hasAttribute(visibleAttribute))).length === 1;\n const atLeastOneVisible = () => controller.intersectionElements.some((element => element.hasAttribute(visibleAttribute)));\n const allVisible = () => controller.intersectionElements.every((element => element.hasAttribute(visibleAttribute)));\n const isVisible = allVisible;\n Object.assign(controller, {\n isVisible: isVisible,\n noneVisible: noneVisible,\n oneVisible: oneVisible,\n atLeastOneVisible: atLeastOneVisible,\n allVisible: allVisible,\n disconnect: disconnect\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass IntersectionComposableController extends Controller {}\n\nclass IntersectionController extends IntersectionComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useIntersection(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst useLazyLoad = (controller, options) => {\n const callback = entries => {\n const [entry] = entries;\n if (entry.isIntersecting && !controller.isLoaded) {\n handleAppear();\n }\n };\n const handleAppear = entry => {\n const src = controller.data.get(\"src\");\n if (!src) return;\n const imageElement = controller.element;\n controller.isLoading = true;\n method(controller, \"loading\").call(controller, src);\n imageElement.onload = () => {\n handleLoaded(src);\n };\n imageElement.src = src;\n };\n const handleLoaded = src => {\n controller.isLoading = false;\n controller.isLoaded = true;\n method(controller, \"loaded\").call(controller, src);\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observer = new IntersectionObserver(callback, options);\n const observe = () => {\n observer.observe(controller.element);\n };\n const unobserve = () => {\n observer.unobserve(controller.element);\n };\n Object.assign(controller, {\n isVisible: false,\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass LazyLoadComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.isLoading = false;\n this.isLoaded = false;\n }\n}\n\nclass LazyLoadController extends LazyLoadComposableController {\n constructor(context) {\n super(context);\n this.options = {\n rootMargin: \"10%\"\n };\n requestAnimationFrame((() => {\n const [observe, unobserve] = useLazyLoad(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst defaultOptions$2 = {\n mediaQueries: {},\n dispatchEvent: true,\n eventPrefix: true,\n debug: false\n};\n\nclass UseMatchMedia extends StimulusUse {\n constructor(controller, options = {}) {\n var _a, _b, _c, _d;\n super(controller, options);\n this.matches = [];\n this.callback = event => {\n const name = Object.keys(this.mediaQueries).find((name => this.mediaQueries[name] === event.media));\n if (!name) return;\n const {media: media, matches: matches} = event;\n this.changed({\n name: name,\n media: media,\n matches: matches,\n event: event\n });\n };\n this.changed = payload => {\n const {name: name} = payload;\n if (payload.event) {\n this.call(camelize(`${name}_changed`), payload);\n this.dispatch(`${name}:changed`, payload);\n this.log(`media query \"${name}\" changed`, payload);\n }\n if (payload.matches) {\n this.call(camelize(`is_${name}`), payload);\n this.dispatch(`is:${name}`, payload);\n } else {\n this.call(camelize(`not_${name}`), payload);\n this.dispatch(`not:${name}`, payload);\n }\n };\n this.observe = () => {\n Object.keys(this.mediaQueries).forEach((name => {\n const media = this.mediaQueries[name];\n const match = window.matchMedia(media);\n match.addListener(this.callback);\n this.matches.push(match);\n this.changed({\n name: name,\n media: media,\n matches: match.matches\n });\n }));\n };\n this.unobserve = () => {\n this.matches.forEach((match => match.removeListener(this.callback)));\n };\n this.controller = controller;\n this.mediaQueries = (_a = options.mediaQueries) !== null && _a !== void 0 ? _a : defaultOptions$2.mediaQueries;\n this.dispatchEvent = (_b = options.dispatchEvent) !== null && _b !== void 0 ? _b : defaultOptions$2.dispatchEvent;\n this.eventPrefix = (_c = options.eventPrefix) !== null && _c !== void 0 ? _c : defaultOptions$2.eventPrefix;\n this.debug = (_d = options.debug) !== null && _d !== void 0 ? _d : defaultOptions$2.debug;\n if (!window.matchMedia) {\n console.error(\"window.matchMedia() is not available\");\n return;\n }\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useMatchMedia = (controller, options = {}) => {\n const observer = new UseMatchMedia(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nconst memoize = (controller, name, value) => {\n Object.defineProperty(controller, name, {\n value: value\n });\n return value;\n};\n\nconst useMemo = controller => {\n var _a;\n (_a = controller.constructor.memos) === null || _a === void 0 ? void 0 : _a.forEach((getter => {\n memoize(controller, getter, controller[getter]);\n }));\n};\n\nconst defineMetaGetter = (controller, metaName, suffix) => {\n const getterName = suffix ? `${camelize(metaName)}Meta` : camelize(metaName);\n Object.defineProperty(controller, getterName, {\n get() {\n return typeCast(metaValue(metaName));\n }\n });\n};\n\nfunction metaValue(name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`);\n return element && element.getAttribute(\"content\");\n}\n\nfunction typeCast(value) {\n try {\n return JSON.parse(value);\n } catch (o_O) {\n return value;\n }\n}\n\nconst useMeta = (controller, options = {\n suffix: true\n}) => {\n const metaNames = controller.constructor.metaNames;\n const suffix = options.suffix;\n metaNames === null || metaNames === void 0 ? void 0 : metaNames.forEach((metaName => {\n defineMetaGetter(controller, metaName, suffix);\n }));\n Object.defineProperty(controller, \"metas\", {\n get() {\n const result = {};\n metaNames === null || metaNames === void 0 ? void 0 : metaNames.forEach((metaName => {\n const value = typeCast(metaValue(metaName));\n if (value !== undefined && value !== null) {\n result[camelize(metaName)] = value;\n }\n }));\n return result;\n }\n });\n};\n\nclass UseMutation extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n try {\n this.observer.observe(this.targetElement, this.options);\n } catch (error) {\n this.controller.application.handleError(error, \"At a minimum, one of childList, attributes, and/or characterData must be true\", {});\n }\n };\n this.unobserve = () => {\n this.observer.disconnect();\n };\n this.mutation = entries => {\n this.call(\"mutate\", entries);\n this.log(\"mutate\", {\n entries: entries\n });\n this.dispatch(\"mutate\", {\n entries: entries\n });\n };\n this.targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n this.controller = controller;\n this.options = options;\n this.observer = new MutationObserver(this.mutation);\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useMutation = (controller, options = {}) => {\n const observer = new UseMutation(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nclass MutationComposableController extends Controller {}\n\nclass MutationController extends MutationComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useMutation(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst defaultOptions$1 = {\n dispatchEvent: true,\n eventPrefix: true\n};\n\nconst useResize = (composableController, options = {}) => {\n const controller = composableController;\n const {dispatchEvent: dispatchEvent, eventPrefix: eventPrefix} = Object.assign({}, defaultOptions$1, options);\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n const callback = entries => {\n const [entry] = entries;\n method(controller, \"resize\").call(controller, entry.contentRect);\n if (dispatchEvent) {\n const eventName = composeEventName(\"resize\", controller, eventPrefix);\n const appearEvent = extendedEvent(eventName, null, {\n controller: controller,\n entry: entry\n });\n targetElement.dispatchEvent(appearEvent);\n }\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observer = new ResizeObserver(callback);\n const observe = () => {\n observer.observe(targetElement);\n };\n const unobserve = () => {\n observer.unobserve(targetElement);\n };\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass ResizeComposableController extends Controller {}\n\nclass ResizeController extends ResizeComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useResize(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nclass UseTargetMutation extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n this.observer.observe(this.targetElement, {\n subtree: true,\n characterData: true,\n childList: true,\n attributes: true,\n attributeOldValue: true,\n attributeFilter: [ this.targetSelector, this.scopedTargetSelector ]\n });\n };\n this.unobserve = () => {\n this.observer.disconnect();\n };\n this.mutation = entries => {\n for (const mutation of entries) {\n switch (mutation.type) {\n case \"attributes\":\n let newValue = mutation.target.getAttribute(mutation.attributeName);\n let oldValue = mutation.oldValue;\n if (mutation.attributeName === this.targetSelector || mutation.attributeName === this.scopedTargetSelector) {\n let oldTargets = this.targetsUsedByThisController(oldValue);\n let newTargets = this.targetsUsedByThisController(newValue);\n let removedTargets = oldTargets.filter((target => !newTargets.includes(target)));\n let addedTargets = newTargets.filter((target => !oldTargets.includes(target)));\n removedTargets.forEach((target => this.targetRemoved(this.stripIdentifierPrefix(target), mutation.target, \"attributeChange\")));\n addedTargets.forEach((target => this.targetAdded(this.stripIdentifierPrefix(target), mutation.target, \"attributeChange\")));\n }\n break;\n\n case \"characterData\":\n let nodule = this.findTargetInAncestry(mutation.target);\n if (nodule == null) {\n return;\n } else {\n let supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n supportedTargets.forEach((target => {\n this.targetChanged(this.stripIdentifierPrefix(target), nodule, \"domMutation\");\n }));\n }\n break;\n\n case \"childList\":\n let {addedNodes: addedNodes, removedNodes: removedNodes} = mutation;\n addedNodes.forEach((node => this.processNodeDOMMutation(node, this.targetAdded)));\n removedNodes.forEach((node => this.processNodeDOMMutation(node, this.targetRemoved)));\n break;\n }\n }\n };\n this.controller = controller;\n this.options = options;\n this.targetElement = controller.element;\n this.identifier = controller.scope.identifier;\n this.identifierPrefix = `${this.identifier}.`;\n this.targetSelector = controller.scope.schema.targetAttribute;\n this.scopedTargetSelector = `data-${this.identifier}-target`;\n this.targets = options.targets || controller.constructor.targets;\n this.prefixedTargets = this.targets.map((target => `${this.identifierPrefix}${target}`));\n this.observer = new MutationObserver(this.mutation);\n this.enhanceController();\n this.observe();\n }\n processNodeDOMMutation(node, initialChangeModeAssumption) {\n let nodule = node;\n let change = initialChangeModeAssumption;\n let supportedTargets = [];\n if (nodule.nodeName == \"#text\" || this.targetsUsedByThisControllerFromNode(nodule).length == 0) {\n change = this.targetChanged;\n nodule = this.findTargetInAncestry(node);\n } else {\n supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n }\n if (nodule == null) {\n return;\n } else if (supportedTargets.length == 0) {\n supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n }\n supportedTargets.forEach((target => {\n change.call(this, this.stripIdentifierPrefix(target), nodule, \"domMutation\");\n }));\n }\n findTargetInAncestry(node) {\n let nodule = node;\n let supportedTargets = [];\n if (nodule.nodeName != \"#text\") {\n supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n }\n while (nodule.parentNode !== null && nodule.parentNode != this.targetElement && supportedTargets.length == 0) {\n nodule = nodule.parentNode;\n if (nodule.nodeName !== \"#text\") {\n let supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n if (supportedTargets.length > 0) {\n return nodule;\n }\n }\n }\n if (nodule.nodeName == \"#text\") {\n return null;\n }\n if (nodule.parentNode == null) {\n return null;\n }\n if (nodule.parentNode == this.targetElement) {\n if (this.targetsUsedByThisControllerFromNode(nodule).length > 0) {\n return nodule;\n }\n return null;\n }\n return null;\n }\n targetAdded(name, node, trigger) {\n let targetCallback = `${name}TargetAdded`;\n this.controller[targetCallback] && method(this.controller, targetCallback).call(this.controller, node);\n this.warn(\"`[target]TargetAdded` is deprecated. Please use the built-in `[target]TargetConnected()` function from Stimulus.\");\n this.log(\"targetAdded\", {\n target: name,\n node: node,\n trigger: trigger\n });\n }\n targetRemoved(name, node, trigger) {\n let targetCallback = `${name}TargetRemoved`;\n this.controller[targetCallback] && method(this.controller, targetCallback).call(this.controller, node);\n this.warn(\"`[target]TargetRemoved` is deprecated. Please use the built-in `[target]TargetDisconnected()` function from Stimulus.\");\n this.log(\"targetRemoved\", {\n target: name,\n node: node,\n trigger: trigger\n });\n }\n targetChanged(name, node, trigger) {\n let targetCallback = `${name}TargetChanged`;\n this.controller[targetCallback] && method(this.controller, targetCallback).call(this.controller, node);\n this.log(\"targetChanged\", {\n target: name,\n node: node,\n trigger: trigger\n });\n }\n targetsUsedByThisControllerFromNode(node) {\n if (node.nodeName == \"#text\" || node.nodeName == \"#comment\") {\n return [];\n }\n let nodeElement = node;\n return this.targetsUsedByThisController(nodeElement.getAttribute(this.scopedTargetSelector) || nodeElement.getAttribute(this.targetSelector));\n }\n targetsUsedByThisController(targetStr) {\n targetStr = targetStr || \"\";\n let targetsToCheck = this.stripIdentifierPrefix(targetStr).split(\" \");\n return this.targets.filter((n => targetsToCheck.indexOf(n) !== -1));\n }\n stripIdentifierPrefix(target) {\n return target.replace(new RegExp(this.identifierPrefix, \"g\"), \"\");\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useTargetMutation = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseTargetMutation(controller, options);\n observer.warn(\"`[target]TargetAdded` and `[target]TargetRemoved` are deprecated. Please use the built-in `[target]TargetConnected()` and `[target]TargetDisconnected()` functions from Stimulus.\");\n return [ observer.observe, observer.unobserve ];\n};\n\nclass TargetMutationComposableController extends Controller {}\n\nclass TargetMutationController extends TargetMutationComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useTargetMutation(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nclass ThrottleController extends Controller {}\n\nThrottleController.throttles = [];\n\nconst defaultWait = 200;\n\nfunction throttle(func, wait = defaultWait) {\n let inThrottle;\n return function() {\n const args = arguments;\n const context = this;\n if (!inThrottle) {\n inThrottle = true;\n func.apply(context, args);\n setTimeout((() => inThrottle = false), wait);\n }\n };\n}\n\nconst useThrottle = (composableController, options = {}) => {\n var _a;\n const controller = composableController;\n const constructor = controller.constructor;\n (_a = constructor.throttles) === null || _a === void 0 ? void 0 : _a.forEach((func => {\n if (typeof func === \"string\") {\n controller[func] = throttle(controller[func], options === null || options === void 0 ? void 0 : options.wait);\n }\n if (typeof func === \"object\") {\n const {name: name, wait: wait} = func;\n if (!name) return;\n controller[name] = throttle(controller[name], wait || (options === null || options === void 0 ? void 0 : options.wait));\n }\n }));\n};\n\nconst alpineNames = {\n enterFromClass: \"enter\",\n enterActiveClass: \"enterStart\",\n enterToClass: \"enterEnd\",\n leaveFromClass: \"leave\",\n leaveActiveClass: \"leaveStart\",\n leaveToClass: \"leaveEnd\"\n};\n\nconst defaultOptions = {\n transitioned: false,\n hiddenClass: \"hidden\",\n preserveOriginalClass: true,\n removeToClasses: true\n};\n\nconst useTransition = (composableController, options = {}) => {\n var _a, _b, _c;\n const controller = composableController;\n const targetName = controller.element.dataset.transitionTarget;\n let targetFromAttribute;\n if (targetName) {\n targetFromAttribute = controller[`${targetName}Target`];\n }\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || targetFromAttribute || controller.element;\n if (!(targetElement instanceof HTMLElement || targetElement instanceof SVGElement)) return;\n const dataset = targetElement.dataset;\n const leaveAfter = parseInt(dataset.leaveAfter || \"\") || options.leaveAfter || 0;\n const {transitioned: transitioned, hiddenClass: hiddenClass, preserveOriginalClass: preserveOriginalClass, removeToClasses: removeToClasses} = Object.assign({}, defaultOptions, options);\n const controllerEnter = (_a = controller.enter) === null || _a === void 0 ? void 0 : _a.bind(controller);\n const controllerLeave = (_b = controller.leave) === null || _b === void 0 ? void 0 : _b.bind(controller);\n const controllerToggleTransition = (_c = controller.toggleTransition) === null || _c === void 0 ? void 0 : _c.bind(controller);\n async function enter(event) {\n if (controller.transitioned) return;\n controller.transitioned = true;\n controllerEnter && controllerEnter(event);\n const enterFromClasses = getAttribute(\"enterFrom\", options, dataset);\n const enterActiveClasses = getAttribute(\"enterActive\", options, dataset);\n const enterToClasses = getAttribute(\"enterTo\", options, dataset);\n const leaveToClasses = getAttribute(\"leaveTo\", options, dataset);\n if (!!hiddenClass) {\n targetElement.classList.remove(hiddenClass);\n }\n if (!removeToClasses) {\n removeClasses(targetElement, leaveToClasses);\n }\n await transition(targetElement, enterFromClasses, enterActiveClasses, enterToClasses, hiddenClass, preserveOriginalClass, removeToClasses);\n if (leaveAfter > 0) {\n setTimeout((() => {\n leave(event);\n }), leaveAfter);\n }\n }\n async function leave(event) {\n if (!controller.transitioned) return;\n controller.transitioned = false;\n controllerLeave && controllerLeave(event);\n const leaveFromClasses = getAttribute(\"leaveFrom\", options, dataset);\n const leaveActiveClasses = getAttribute(\"leaveActive\", options, dataset);\n const leaveToClasses = getAttribute(\"leaveTo\", options, dataset);\n const enterToClasses = getAttribute(\"enterTo\", options, dataset);\n if (!removeToClasses) {\n removeClasses(targetElement, enterToClasses);\n }\n await transition(targetElement, leaveFromClasses, leaveActiveClasses, leaveToClasses, hiddenClass, preserveOriginalClass, removeToClasses);\n if (!!hiddenClass) {\n targetElement.classList.add(hiddenClass);\n }\n }\n function toggleTransition(event) {\n controllerToggleTransition && controllerToggleTransition(event);\n if (controller.transitioned) {\n leave();\n } else {\n enter();\n }\n }\n async function transition(element, initialClasses, activeClasses, endClasses, hiddenClass, preserveOriginalClass, removeEndClasses) {\n const stashedClasses = [];\n if (preserveOriginalClass) {\n initialClasses.forEach((cls => element.classList.contains(cls) && cls !== hiddenClass && stashedClasses.push(cls)));\n activeClasses.forEach((cls => element.classList.contains(cls) && cls !== hiddenClass && stashedClasses.push(cls)));\n endClasses.forEach((cls => element.classList.contains(cls) && cls !== hiddenClass && stashedClasses.push(cls)));\n }\n addClasses(element, initialClasses);\n removeClasses(element, stashedClasses);\n addClasses(element, activeClasses);\n await nextAnimationFrame();\n removeClasses(element, initialClasses);\n addClasses(element, endClasses);\n await afterTransition(element);\n removeClasses(element, activeClasses);\n if (removeEndClasses) {\n removeClasses(element, endClasses);\n }\n addClasses(element, stashedClasses);\n }\n function initialState() {\n controller.transitioned = transitioned;\n if (transitioned) {\n if (!!hiddenClass) {\n targetElement.classList.remove(hiddenClass);\n }\n enter();\n } else {\n if (!!hiddenClass) {\n targetElement.classList.add(hiddenClass);\n }\n leave();\n }\n }\n function addClasses(element, classes) {\n if (classes.length > 0) {\n element.classList.add(...classes);\n }\n }\n function removeClasses(element, classes) {\n if (classes.length > 0) {\n element.classList.remove(...classes);\n }\n }\n initialState();\n Object.assign(controller, {\n enter: enter,\n leave: leave,\n toggleTransition: toggleTransition\n });\n return [ enter, leave, toggleTransition ];\n};\n\nfunction getAttribute(name, options, dataset) {\n const datasetName = `transition${name[0].toUpperCase()}${name.substr(1)}`;\n const datasetAlpineName = alpineNames[name];\n const classes = options[name] || dataset[datasetName] || dataset[datasetAlpineName] || \" \";\n return isEmpty(classes) ? [] : classes.split(\" \");\n}\n\nasync function afterTransition(element) {\n return new Promise((resolve => {\n const duration = Number(getComputedStyle(element).transitionDuration.split(\",\")[0].replace(\"s\", \"\")) * 1e3;\n setTimeout((() => {\n resolve(duration);\n }), duration);\n }));\n}\n\nasync function nextAnimationFrame() {\n return new Promise((resolve => {\n requestAnimationFrame((() => {\n requestAnimationFrame(resolve);\n }));\n }));\n}\n\nfunction isEmpty(str) {\n return str.length === 0 || !str.trim();\n}\n\nclass TransitionComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.transitioned = false;\n }\n}\n\nclass TransitionController extends TransitionComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n useTransition(this, this.options);\n }));\n }\n}\n\nclass UseVisibility extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n this.controller.isVisible = !document.hidden;\n document.addEventListener(\"visibilitychange\", this.handleVisibilityChange);\n this.handleVisibilityChange();\n };\n this.unobserve = () => {\n document.removeEventListener(\"visibilitychange\", this.handleVisibilityChange);\n };\n this.becomesInvisible = event => {\n this.controller.isVisible = false;\n this.call(\"invisible\", event);\n this.log(\"invisible\", {\n isVisible: false\n });\n this.dispatch(\"invisible\", {\n event: event,\n isVisible: false\n });\n };\n this.becomesVisible = event => {\n this.controller.isVisible = true;\n this.call(\"visible\", event);\n this.log(\"visible\", {\n isVisible: true\n });\n this.dispatch(\"visible\", {\n event: event,\n isVisible: true\n });\n };\n this.handleVisibilityChange = event => {\n if (document.hidden) {\n this.becomesInvisible(event);\n } else {\n this.becomesVisible(event);\n }\n };\n this.controller = controller;\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controllerDisconnect;\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useVisibility = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseVisibility(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nclass VisibilityComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.isVisible = false;\n }\n}\n\nclass VisibilityController extends VisibilityComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useVisibility(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nclass UseWindowFocus extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n if (document.hasFocus()) {\n this.becomesFocused();\n } else {\n this.becomesUnfocused();\n }\n this.interval = setInterval((() => {\n this.handleWindowFocusChange();\n }), this.intervalDuration);\n };\n this.unobserve = () => {\n clearInterval(this.interval);\n };\n this.becomesUnfocused = event => {\n this.controller.hasFocus = false;\n this.call(\"unfocus\", event);\n this.log(\"unfocus\", {\n hasFocus: false\n });\n this.dispatch(\"unfocus\", {\n event: event,\n hasFocus: false\n });\n };\n this.becomesFocused = event => {\n this.controller.hasFocus = true;\n this.call(\"focus\", event);\n this.log(\"focus\", {\n hasFocus: true\n });\n this.dispatch(\"focus\", {\n event: event,\n hasFocus: true\n });\n };\n this.handleWindowFocusChange = event => {\n if (document.hasFocus() && !this.controller.hasFocus) {\n this.becomesFocused(event);\n } else if (!document.hasFocus() && this.controller.hasFocus) {\n this.becomesUnfocused(event);\n }\n };\n this.controller = controller;\n this.intervalDuration = options.interval || 200;\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controllerDisconnect;\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useWindowFocus = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseWindowFocus(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nclass WindowFocusComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.hasFocus = false;\n }\n}\n\nclass WindowFocusController extends WindowFocusComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useWindowFocus(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst useWindowResize = composableController => {\n const controller = composableController;\n const callback = event => {\n const {innerWidth: innerWidth, innerHeight: innerHeight} = window;\n const payload = {\n height: innerHeight || Infinity,\n width: innerWidth || Infinity,\n event: event\n };\n method(controller, \"windowResize\").call(controller, payload);\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observe = () => {\n window.addEventListener(\"resize\", callback);\n callback();\n };\n const unobserve = () => {\n window.removeEventListener(\"resize\", callback);\n };\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass WindowResizeComposableController extends Controller {}\n\nclass WindowResizeController extends WindowResizeComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useWindowResize(this);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nfunction useHotkeys() {\n throw \"[stimulus-use] Notice: The import for `useHotkeys()` has been moved from `stimulus-use` to `stimulus-use/hotkeys`. \\nPlease change the import accordingly and add `hotkey-js` as a dependency to your project. \\n\\nFor more information see: https://stimulus-use.github.io/stimulus-use/#/use-hotkeys?id=importing-the-behavior\";\n}\n\nexport { ApplicationController, ClickOutsideController, HoverController, IdleController, IntersectionController, LazyLoadController, MutationController, ResizeController, TargetMutationController, TransitionController, UseHover, UseMutation, UseTargetMutation, UseVisibility, UseWindowFocus, VisibilityController, WindowFocusController, WindowResizeController, debounce, useApplication, useClickOutside, useDebounce, useDispatch, useHotkeys, useHover, useIdle, useIntersection, useLazyLoad, useMatchMedia, useMemo, useMeta, useMutation, useResize, useTargetMutation, useThrottle, useTransition, useVisibility, useWindowFocus, useWindowResize };\n", "import { Controller } from '@hotwired/stimulus'\nimport { Turbo } from '@hotwired/turbo-rails'\nimport { get } from '@rails/request.js'\nimport { useDebounce } from 'stimulus-use'\nimport { enter, leave } from 'el-transition'\n\nexport default class extends Controller {\n static debounces = ['inputChangedHandler']\n static targets = [\n 'input',\n 'results',\n 'details',\n 'wrapper',\n 'background',\n 'container',\n 'outerContainer',\n ]\n static values = { open: Boolean }\n\n declare readonly inputTarget: HTMLInputElement\n declare readonly resultsTarget: HTMLUListElement\n declare readonly detailsTarget: HTMLDivElement\n declare readonly wrapperTarget: HTMLDivElement\n declare readonly backgroundTarget: HTMLDivElement\n declare readonly containerTarget: HTMLDivElement\n declare readonly outerContainerTarget: HTMLDivElement\n declare openValue: boolean\n declare readonly hasOpenValue: boolean\n\n activeIndex: number = 0\n capturedFocus: boolean = false\n toggleClasses = [\n 'bg-gray-100',\n 'text-gray-900',\n 'dark:bg-neutral-700',\n 'dark:text-neutral-100',\n ]\n hiddenClass = '!hidden'\n\n // initialize(): void {\n // this.activeIndex = 0\n // this.capturedFocus = false\n // }\n\n connect() {\n useDebounce(this, { wait: 300 })\n this.setupHotkeys()\n this.setupListener()\n this.setupHoverListener()\n this.setupClickListener()\n this.inputTarget.focus()\n document.addEventListener('keydown', this.toggleOpen)\n }\n\n disconnect(): void {\n this.resultsTarget.removeEventListener('mouseover', this.hoverListener)\n this.detailsTarget.removeEventListener('click', this.clickListener)\n this.inputTarget.removeEventListener('keydown', this.keyboardListener)\n this.inputTarget.removeEventListener('input', this.inputChangedHandler)\n document.removeEventListener('keydown', this.toggleOpen)\n }\n\n openValueChanged() {\n if (this.openValue) {\n this.show()\n } else {\n this.hide()\n }\n }\n\n private toggleOpen = (event: KeyboardEvent) => {\n if (event.metaKey && event.key === 'k') {\n event.preventDefault()\n this.openValue = !this.openValue\n }\n }\n\n private show() {\n this.inputTarget.value = ''\n this.wrapperTarget.classList.remove('hidden')\n enter(this.containerTarget)\n enter(this.backgroundTarget)\n this.inputTarget.focus()\n this.inputTarget.selectionStart = this.inputTarget.selectionEnd =\n this.inputTarget.value.length\n }\n\n close() {\n this.inputTarget.value = ''\n this.getSearchResults('')\n this.openValue = false\n }\n\n closeBackground(event) {\n if (event.target === this.outerContainerTarget) {\n this.close()\n }\n }\n\n private hide() {\n Promise.all([\n leave(this.backgroundTarget),\n leave(this.containerTarget),\n ]).then(() => {\n this.wrapperTarget.classList.add('hidden')\n })\n }\n\n private setupClickListener() {\n this.detailsTarget.addEventListener('click', this.clickListener)\n }\n\n private clickListener = event => {\n const targets = ['BUTTON', 'A']\n\n if (targets.includes(event.target.tagName)) {\n this.close()\n }\n }\n\n private setupHoverListener() {\n this.resultsTarget.addEventListener('mouseover', this.hoverListener)\n }\n\n private hoverListener = event => {\n if (!this.openValue) return\n\n if ('index' in event.target.dataset) {\n const index = parseInt(event.target.dataset.index)\n this.focusElementIndex(index, { scroll: false })\n }\n }\n\n private setupHotkeys() {\n this.inputTarget.addEventListener('keydown', this.keyboardListener)\n }\n\n keyboardListener = e => {\n if (!this.openValue) return\n\n switch (e.key) {\n case 'Escape':\n this.close()\n break\n case 'Enter':\n e.preventDefault()\n this.goToActiveIndex()\n break\n case 'Tab':\n if (!this.capturedFocus) {\n e.preventDefault()\n // used for first time, to capture focus, then we let the browser do it's thing\n this._focusFirstElement()\n }\n break\n case 'ArrowUp':\n this.upHandler()\n e.preventDefault()\n break\n case 'ArrowDown':\n this.downHandler()\n e.preventDefault()\n break\n }\n }\n\n private goToActiveIndex() {\n if (!this.keyboardFocusableElements.length) return\n\n const url = this.keyboardFocusableElements[this.activeIndex].dataset.url\n Turbo.visit(url)\n }\n\n private downHandler() {\n if (this.keyboardFocusableElements.length === 0) return\n\n if (!this.capturedFocus) {\n this._focusFirstElement()\n } else if (this.activeIndex === this.keyboardFocusableElements.length - 1) {\n this.activeIndex = 0\n this._focusFirstElement()\n } else {\n this.focusElementIndex(this.activeIndex + 1)\n this.activeIndex += 1\n }\n }\n\n _focusFirstElement() {\n if (this.keyboardFocusableElements.length === 0) return\n\n this.focusElementIndex(0)\n this.capturedFocus = true\n }\n\n _focusLastElement() {\n if (this.keyboardFocusableElements.length === 0) return\n\n const lastItemIndex = this.keyboardFocusableElements.length - 1\n this.focusElementIndex(lastItemIndex)\n this.activeIndex = lastItemIndex\n }\n\n private focusElementIndex(index: number, options = { scroll: true }) {\n this.keyboardFocusableElements.forEach((element, idx) => {\n if (idx === index) {\n element.classList.add(...this.toggleClasses)\n const id = element.id.replace('result_', '')\n this.detailsTarget\n .querySelector(`#detail_${id}`)\n ?.classList.remove(this.hiddenClass)\n element.querySelector('.chevron')?.classList.remove('hidden')\n } else {\n element.classList.remove(...this.toggleClasses)\n const id = element.id.replace('result_', '')\n this.detailsTarget\n .querySelector(`#detail_${id}`)\n ?.classList.add(this.hiddenClass)\n element.querySelector('.chevron')?.classList.add('hidden')\n }\n })\n if (options.scroll) {\n this.keyboardFocusableElements[index].scrollIntoView({\n behavior: 'smooth',\n block: 'end',\n inline: 'nearest',\n })\n }\n }\n\n private upHandler() {\n if (this.activeIndex === 0) {\n this._focusLastElement()\n return\n }\n\n if (this.capturedFocus && this.activeIndex >= 1) {\n this.focusElementIndex(this.activeIndex - 1)\n this.activeIndex -= 1\n }\n }\n\n private setupListener() {\n this.inputTarget.addEventListener('input', this.inputChangedHandler)\n }\n\n private inputChangedHandler = (event: any) => {\n this.getSearchResults(event.target.value)\n }\n\n private async getSearchResults(term: string) {\n try {\n this.activeIndex = 0\n await get('/search', {\n query: {\n q: term,\n },\n responseKind: 'turbo-stream',\n })\n setTimeout(() => {\n this._focusFirstElement()\n }, 100)\n } catch (error) {\n console.log(error)\n }\n }\n\n get keyboardFocusableElements() {\n return [...this.resultsTarget.querySelectorAll('[tabindex]')].filter(\n el => !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden')\n )\n }\n\n get detailElements() {\n return this.detailsTarget.querySelectorAll('.command-palette-detail')\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['container', 'select']\n\n connect() {\n if (!this.hasSelectTarget) return\n\n const { value } = this.selectTarget\n this.toggleVisibilityForType(value)\n }\n\n changeType(event) {\n const { value } = event.target\n\n this.toggleVisibilityForType(value)\n }\n\n toggleVisibilityForType(type) {\n if (['select', 'checkboxes'].includes(type)) {\n this.containerTarget.classList.remove('hidden')\n } else {\n this.containerTarget.classList.add('hidden')\n }\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { get } from '@rails/request.js'\n\nexport default class extends Controller {\n refreshTimer: number\n refreshIntervalValue = 10000\n\n connect(): void {\n this.startRefreshing()\n }\n\n disconnect(): void {\n this.stopRefreshing()\n }\n\n startRefreshing(): void {\n this.refreshTimer = setInterval(() => {\n this.fetch()\n }, this.refreshIntervalValue)\n }\n\n stopRefreshing(): void {\n if (this.refreshTimer) {\n clearInterval(this.refreshTimer)\n }\n }\n\n fetch(): void {\n get(`/`, {\n responseKind: 'turbo-stream',\n })\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { Turbo } from '@hotwired/turbo-rails'\n\nexport default class extends Controller {\n urlValue: string\n\n static values = {\n url: String,\n }\n\n dateChanged(event) {\n const url = new URL(window.location.href)\n url.searchParams.set('week_commencing', event.target.value)\n Turbo.visit(url, {\n action: 'replace',\n })\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { enter, leave } from 'el-transition'\n\n// Connects to data-controller=\"filters\"\nexport default class extends Controller {\n static targets = ['sidebar', 'background', 'panel']\n\n toggle() {\n // // if (this.sidebarTarget.classList.contains('hidden')) {\n // if (this.sidebarTarget.style.display === 'none') {\n // // enter(this.sidebarTarget)\n // this.sidebarTarget.style.display = ''\n // } else {\n // // leave(this.sidebarTarget).then(() => {\n // // this.sidebarTarget.classList.add('hidden')\n // // })\n // this.sidebarTarget.style.display = 'none'\n // }\n\n if (this.sidebarTarget.classList.contains('hidden')) {\n // if (this.sidebarTarget.style.display === 'none') {\n this.sidebarTarget.classList.remove('hidden')\n enter(this.backgroundTarget)\n enter(this.panelTarget)\n // enter(this.overlayTarget)\n } else {\n Promise.all([\n leave(this.backgroundTarget),\n leave(this.panelTarget),\n // leave(this.overlayTarget),\n ]).then(() => {\n this.sidebarTarget.classList.add('hidden')\n })\n }\n }\n\n submit(event) {\n const { name, checked, value, type } = event.target\n const url = new URL(window.location.href)\n\n if (type === 'checkbox') {\n if (/\\[\\]/.test(name)) {\n url.searchParams.set(name, value)\n } else if (checked) {\n url.searchParams.set(name, checked)\n }\n } else if (type !== 'checkbox' && value.length) {\n url.searchParams.set(name, value)\n } else {\n url.searchParams.delete(name)\n }\n\n Turbo.visit(url, { action: 'replace' })\n }\n}\n", "// canvas-confetti v1.9.3 built on 2024-04-30T22:19:17.794Z\nvar module = {};\n\n// source content\n/* globals Map */\n\n(function main(global, module, isWorker, workerSize) {\n var canUseWorker = !!(\n global.Worker &&\n global.Blob &&\n global.Promise &&\n global.OffscreenCanvas &&\n global.OffscreenCanvasRenderingContext2D &&\n global.HTMLCanvasElement &&\n global.HTMLCanvasElement.prototype.transferControlToOffscreen &&\n global.URL &&\n global.URL.createObjectURL);\n\n var canUsePaths = typeof Path2D === 'function' && typeof DOMMatrix === 'function';\n var canDrawBitmap = (function () {\n // this mostly supports ssr\n if (!global.OffscreenCanvas) {\n return false;\n }\n\n var canvas = new OffscreenCanvas(1, 1);\n var ctx = canvas.getContext('2d');\n ctx.fillRect(0, 0, 1, 1);\n var bitmap = canvas.transferToImageBitmap();\n\n try {\n ctx.createPattern(bitmap, 'no-repeat');\n } catch (e) {\n return false;\n }\n\n return true;\n })();\n\n function noop() {}\n\n // create a promise if it exists, otherwise, just\n // call the function directly\n function promise(func) {\n var ModulePromise = module.exports.Promise;\n var Prom = ModulePromise !== void 0 ? ModulePromise : global.Promise;\n\n if (typeof Prom === 'function') {\n return new Prom(func);\n }\n\n func(noop, noop);\n\n return null;\n }\n\n var bitmapMapper = (function (skipTransform, map) {\n // see https://github.com/catdad/canvas-confetti/issues/209\n // creating canvases is actually pretty expensive, so we should create a\n // 1:1 map for bitmap:canvas, so that we can animate the confetti in\n // a performant manner, but also not store them forever so that we don't\n // have a memory leak\n return {\n transform: function(bitmap) {\n if (skipTransform) {\n return bitmap;\n }\n\n if (map.has(bitmap)) {\n return map.get(bitmap);\n }\n\n var canvas = new OffscreenCanvas(bitmap.width, bitmap.height);\n var ctx = canvas.getContext('2d');\n ctx.drawImage(bitmap, 0, 0);\n\n map.set(bitmap, canvas);\n\n return canvas;\n },\n clear: function () {\n map.clear();\n }\n };\n })(canDrawBitmap, new Map());\n\n var raf = (function () {\n var TIME = Math.floor(1000 / 60);\n var frame, cancel;\n var frames = {};\n var lastFrameTime = 0;\n\n if (typeof requestAnimationFrame === 'function' && typeof cancelAnimationFrame === 'function') {\n frame = function (cb) {\n var id = Math.random();\n\n frames[id] = requestAnimationFrame(function onFrame(time) {\n if (lastFrameTime === time || lastFrameTime + TIME - 1 < time) {\n lastFrameTime = time;\n delete frames[id];\n\n cb();\n } else {\n frames[id] = requestAnimationFrame(onFrame);\n }\n });\n\n return id;\n };\n cancel = function (id) {\n if (frames[id]) {\n cancelAnimationFrame(frames[id]);\n }\n };\n } else {\n frame = function (cb) {\n return setTimeout(cb, TIME);\n };\n cancel = function (timer) {\n return clearTimeout(timer);\n };\n }\n\n return { frame: frame, cancel: cancel };\n }());\n\n var getWorker = (function () {\n var worker;\n var prom;\n var resolves = {};\n\n function decorate(worker) {\n function execute(options, callback) {\n worker.postMessage({ options: options || {}, callback: callback });\n }\n worker.init = function initWorker(canvas) {\n var offscreen = canvas.transferControlToOffscreen();\n worker.postMessage({ canvas: offscreen }, [offscreen]);\n };\n\n worker.fire = function fireWorker(options, size, done) {\n if (prom) {\n execute(options, null);\n return prom;\n }\n\n var id = Math.random().toString(36).slice(2);\n\n prom = promise(function (resolve) {\n function workerDone(msg) {\n if (msg.data.callback !== id) {\n return;\n }\n\n delete resolves[id];\n worker.removeEventListener('message', workerDone);\n\n prom = null;\n\n bitmapMapper.clear();\n\n done();\n resolve();\n }\n\n worker.addEventListener('message', workerDone);\n execute(options, id);\n\n resolves[id] = workerDone.bind(null, { data: { callback: id }});\n });\n\n return prom;\n };\n\n worker.reset = function resetWorker() {\n worker.postMessage({ reset: true });\n\n for (var id in resolves) {\n resolves[id]();\n delete resolves[id];\n }\n };\n }\n\n return function () {\n if (worker) {\n return worker;\n }\n\n if (!isWorker && canUseWorker) {\n var code = [\n 'var CONFETTI, SIZE = {}, module = {};',\n '(' + main.toString() + ')(this, module, true, SIZE);',\n 'onmessage = function(msg) {',\n ' if (msg.data.options) {',\n ' CONFETTI(msg.data.options).then(function () {',\n ' if (msg.data.callback) {',\n ' postMessage({ callback: msg.data.callback });',\n ' }',\n ' });',\n ' } else if (msg.data.reset) {',\n ' CONFETTI && CONFETTI.reset();',\n ' } else if (msg.data.resize) {',\n ' SIZE.width = msg.data.resize.width;',\n ' SIZE.height = msg.data.resize.height;',\n ' } else if (msg.data.canvas) {',\n ' SIZE.width = msg.data.canvas.width;',\n ' SIZE.height = msg.data.canvas.height;',\n ' CONFETTI = module.exports.create(msg.data.canvas);',\n ' }',\n '}',\n ].join('\\n');\n try {\n worker = new Worker(URL.createObjectURL(new Blob([code])));\n } catch (e) {\n // eslint-disable-next-line no-console\n typeof console !== undefined && typeof console.warn === 'function' ? console.warn('\uD83C\uDF8A Could not load worker', e) : null;\n\n return null;\n }\n\n decorate(worker);\n }\n\n return worker;\n };\n })();\n\n var defaults = {\n particleCount: 50,\n angle: 90,\n spread: 45,\n startVelocity: 45,\n decay: 0.9,\n gravity: 1,\n drift: 0,\n ticks: 200,\n x: 0.5,\n y: 0.5,\n shapes: ['square', 'circle'],\n zIndex: 100,\n colors: [\n '#26ccff',\n '#a25afd',\n '#ff5e7e',\n '#88ff5a',\n '#fcff42',\n '#ffa62d',\n '#ff36ff'\n ],\n // probably should be true, but back-compat\n disableForReducedMotion: false,\n scalar: 1\n };\n\n function convert(val, transform) {\n return transform ? transform(val) : val;\n }\n\n function isOk(val) {\n return !(val === null || val === undefined);\n }\n\n function prop(options, name, transform) {\n return convert(\n options && isOk(options[name]) ? options[name] : defaults[name],\n transform\n );\n }\n\n function onlyPositiveInt(number){\n return number < 0 ? 0 : Math.floor(number);\n }\n\n function randomInt(min, max) {\n // [min, max)\n return Math.floor(Math.random() * (max - min)) + min;\n }\n\n function toDecimal(str) {\n return parseInt(str, 16);\n }\n\n function colorsToRgb(colors) {\n return colors.map(hexToRgb);\n }\n\n function hexToRgb(str) {\n var val = String(str).replace(/[^0-9a-f]/gi, '');\n\n if (val.length < 6) {\n val = val[0]+val[0]+val[1]+val[1]+val[2]+val[2];\n }\n\n return {\n r: toDecimal(val.substring(0,2)),\n g: toDecimal(val.substring(2,4)),\n b: toDecimal(val.substring(4,6))\n };\n }\n\n function getOrigin(options) {\n var origin = prop(options, 'origin', Object);\n origin.x = prop(origin, 'x', Number);\n origin.y = prop(origin, 'y', Number);\n\n return origin;\n }\n\n function setCanvasWindowSize(canvas) {\n canvas.width = document.documentElement.clientWidth;\n canvas.height = document.documentElement.clientHeight;\n }\n\n function setCanvasRectSize(canvas) {\n var rect = canvas.getBoundingClientRect();\n canvas.width = rect.width;\n canvas.height = rect.height;\n }\n\n function getCanvas(zIndex) {\n var canvas = document.createElement('canvas');\n\n canvas.style.position = 'fixed';\n canvas.style.top = '0px';\n canvas.style.left = '0px';\n canvas.style.pointerEvents = 'none';\n canvas.style.zIndex = zIndex;\n\n return canvas;\n }\n\n function ellipse(context, x, y, radiusX, radiusY, rotation, startAngle, endAngle, antiClockwise) {\n context.save();\n context.translate(x, y);\n context.rotate(rotation);\n context.scale(radiusX, radiusY);\n context.arc(0, 0, 1, startAngle, endAngle, antiClockwise);\n context.restore();\n }\n\n function randomPhysics(opts) {\n var radAngle = opts.angle * (Math.PI / 180);\n var radSpread = opts.spread * (Math.PI / 180);\n\n return {\n x: opts.x,\n y: opts.y,\n wobble: Math.random() * 10,\n wobbleSpeed: Math.min(0.11, Math.random() * 0.1 + 0.05),\n velocity: (opts.startVelocity * 0.5) + (Math.random() * opts.startVelocity),\n angle2D: -radAngle + ((0.5 * radSpread) - (Math.random() * radSpread)),\n tiltAngle: (Math.random() * (0.75 - 0.25) + 0.25) * Math.PI,\n color: opts.color,\n shape: opts.shape,\n tick: 0,\n totalTicks: opts.ticks,\n decay: opts.decay,\n drift: opts.drift,\n random: Math.random() + 2,\n tiltSin: 0,\n tiltCos: 0,\n wobbleX: 0,\n wobbleY: 0,\n gravity: opts.gravity * 3,\n ovalScalar: 0.6,\n scalar: opts.scalar,\n flat: opts.flat\n };\n }\n\n function updateFetti(context, fetti) {\n fetti.x += Math.cos(fetti.angle2D) * fetti.velocity + fetti.drift;\n fetti.y += Math.sin(fetti.angle2D) * fetti.velocity + fetti.gravity;\n fetti.velocity *= fetti.decay;\n\n if (fetti.flat) {\n fetti.wobble = 0;\n fetti.wobbleX = fetti.x + (10 * fetti.scalar);\n fetti.wobbleY = fetti.y + (10 * fetti.scalar);\n\n fetti.tiltSin = 0;\n fetti.tiltCos = 0;\n fetti.random = 1;\n } else {\n fetti.wobble += fetti.wobbleSpeed;\n fetti.wobbleX = fetti.x + ((10 * fetti.scalar) * Math.cos(fetti.wobble));\n fetti.wobbleY = fetti.y + ((10 * fetti.scalar) * Math.sin(fetti.wobble));\n\n fetti.tiltAngle += 0.1;\n fetti.tiltSin = Math.sin(fetti.tiltAngle);\n fetti.tiltCos = Math.cos(fetti.tiltAngle);\n fetti.random = Math.random() + 2;\n }\n\n var progress = (fetti.tick++) / fetti.totalTicks;\n\n var x1 = fetti.x + (fetti.random * fetti.tiltCos);\n var y1 = fetti.y + (fetti.random * fetti.tiltSin);\n var x2 = fetti.wobbleX + (fetti.random * fetti.tiltCos);\n var y2 = fetti.wobbleY + (fetti.random * fetti.tiltSin);\n\n context.fillStyle = 'rgba(' + fetti.color.r + ', ' + fetti.color.g + ', ' + fetti.color.b + ', ' + (1 - progress) + ')';\n\n context.beginPath();\n\n if (canUsePaths && fetti.shape.type === 'path' && typeof fetti.shape.path === 'string' && Array.isArray(fetti.shape.matrix)) {\n context.fill(transformPath2D(\n fetti.shape.path,\n fetti.shape.matrix,\n fetti.x,\n fetti.y,\n Math.abs(x2 - x1) * 0.1,\n Math.abs(y2 - y1) * 0.1,\n Math.PI / 10 * fetti.wobble\n ));\n } else if (fetti.shape.type === 'bitmap') {\n var rotation = Math.PI / 10 * fetti.wobble;\n var scaleX = Math.abs(x2 - x1) * 0.1;\n var scaleY = Math.abs(y2 - y1) * 0.1;\n var width = fetti.shape.bitmap.width * fetti.scalar;\n var height = fetti.shape.bitmap.height * fetti.scalar;\n\n var matrix = new DOMMatrix([\n Math.cos(rotation) * scaleX,\n Math.sin(rotation) * scaleX,\n -Math.sin(rotation) * scaleY,\n Math.cos(rotation) * scaleY,\n fetti.x,\n fetti.y\n ]);\n\n // apply the transform matrix from the confetti shape\n matrix.multiplySelf(new DOMMatrix(fetti.shape.matrix));\n\n var pattern = context.createPattern(bitmapMapper.transform(fetti.shape.bitmap), 'no-repeat');\n pattern.setTransform(matrix);\n\n context.globalAlpha = (1 - progress);\n context.fillStyle = pattern;\n context.fillRect(\n fetti.x - (width / 2),\n fetti.y - (height / 2),\n width,\n height\n );\n context.globalAlpha = 1;\n } else if (fetti.shape === 'circle') {\n context.ellipse ?\n context.ellipse(fetti.x, fetti.y, Math.abs(x2 - x1) * fetti.ovalScalar, Math.abs(y2 - y1) * fetti.ovalScalar, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI) :\n ellipse(context, fetti.x, fetti.y, Math.abs(x2 - x1) * fetti.ovalScalar, Math.abs(y2 - y1) * fetti.ovalScalar, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI);\n } else if (fetti.shape === 'star') {\n var rot = Math.PI / 2 * 3;\n var innerRadius = 4 * fetti.scalar;\n var outerRadius = 8 * fetti.scalar;\n var x = fetti.x;\n var y = fetti.y;\n var spikes = 5;\n var step = Math.PI / spikes;\n\n while (spikes--) {\n x = fetti.x + Math.cos(rot) * outerRadius;\n y = fetti.y + Math.sin(rot) * outerRadius;\n context.lineTo(x, y);\n rot += step;\n\n x = fetti.x + Math.cos(rot) * innerRadius;\n y = fetti.y + Math.sin(rot) * innerRadius;\n context.lineTo(x, y);\n rot += step;\n }\n } else {\n context.moveTo(Math.floor(fetti.x), Math.floor(fetti.y));\n context.lineTo(Math.floor(fetti.wobbleX), Math.floor(y1));\n context.lineTo(Math.floor(x2), Math.floor(y2));\n context.lineTo(Math.floor(x1), Math.floor(fetti.wobbleY));\n }\n\n context.closePath();\n context.fill();\n\n return fetti.tick < fetti.totalTicks;\n }\n\n function animate(canvas, fettis, resizer, size, done) {\n var animatingFettis = fettis.slice();\n var context = canvas.getContext('2d');\n var animationFrame;\n var destroy;\n\n var prom = promise(function (resolve) {\n function onDone() {\n animationFrame = destroy = null;\n\n context.clearRect(0, 0, size.width, size.height);\n bitmapMapper.clear();\n\n done();\n resolve();\n }\n\n function update() {\n if (isWorker && !(size.width === workerSize.width && size.height === workerSize.height)) {\n size.width = canvas.width = workerSize.width;\n size.height = canvas.height = workerSize.height;\n }\n\n if (!size.width && !size.height) {\n resizer(canvas);\n size.width = canvas.width;\n size.height = canvas.height;\n }\n\n context.clearRect(0, 0, size.width, size.height);\n\n animatingFettis = animatingFettis.filter(function (fetti) {\n return updateFetti(context, fetti);\n });\n\n if (animatingFettis.length) {\n animationFrame = raf.frame(update);\n } else {\n onDone();\n }\n }\n\n animationFrame = raf.frame(update);\n destroy = onDone;\n });\n\n return {\n addFettis: function (fettis) {\n animatingFettis = animatingFettis.concat(fettis);\n\n return prom;\n },\n canvas: canvas,\n promise: prom,\n reset: function () {\n if (animationFrame) {\n raf.cancel(animationFrame);\n }\n\n if (destroy) {\n destroy();\n }\n }\n };\n }\n\n function confettiCannon(canvas, globalOpts) {\n var isLibCanvas = !canvas;\n var allowResize = !!prop(globalOpts || {}, 'resize');\n var hasResizeEventRegistered = false;\n var globalDisableForReducedMotion = prop(globalOpts, 'disableForReducedMotion', Boolean);\n var shouldUseWorker = canUseWorker && !!prop(globalOpts || {}, 'useWorker');\n var worker = shouldUseWorker ? getWorker() : null;\n var resizer = isLibCanvas ? setCanvasWindowSize : setCanvasRectSize;\n var initialized = (canvas && worker) ? !!canvas.__confetti_initialized : false;\n var preferLessMotion = typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion)').matches;\n var animationObj;\n\n function fireLocal(options, size, done) {\n var particleCount = prop(options, 'particleCount', onlyPositiveInt);\n var angle = prop(options, 'angle', Number);\n var spread = prop(options, 'spread', Number);\n var startVelocity = prop(options, 'startVelocity', Number);\n var decay = prop(options, 'decay', Number);\n var gravity = prop(options, 'gravity', Number);\n var drift = prop(options, 'drift', Number);\n var colors = prop(options, 'colors', colorsToRgb);\n var ticks = prop(options, 'ticks', Number);\n var shapes = prop(options, 'shapes');\n var scalar = prop(options, 'scalar');\n var flat = !!prop(options, 'flat');\n var origin = getOrigin(options);\n\n var temp = particleCount;\n var fettis = [];\n\n var startX = canvas.width * origin.x;\n var startY = canvas.height * origin.y;\n\n while (temp--) {\n fettis.push(\n randomPhysics({\n x: startX,\n y: startY,\n angle: angle,\n spread: spread,\n startVelocity: startVelocity,\n color: colors[temp % colors.length],\n shape: shapes[randomInt(0, shapes.length)],\n ticks: ticks,\n decay: decay,\n gravity: gravity,\n drift: drift,\n scalar: scalar,\n flat: flat\n })\n );\n }\n\n // if we have a previous canvas already animating,\n // add to it\n if (animationObj) {\n return animationObj.addFettis(fettis);\n }\n\n animationObj = animate(canvas, fettis, resizer, size , done);\n\n return animationObj.promise;\n }\n\n function fire(options) {\n var disableForReducedMotion = globalDisableForReducedMotion || prop(options, 'disableForReducedMotion', Boolean);\n var zIndex = prop(options, 'zIndex', Number);\n\n if (disableForReducedMotion && preferLessMotion) {\n return promise(function (resolve) {\n resolve();\n });\n }\n\n if (isLibCanvas && animationObj) {\n // use existing canvas from in-progress animation\n canvas = animationObj.canvas;\n } else if (isLibCanvas && !canvas) {\n // create and initialize a new canvas\n canvas = getCanvas(zIndex);\n document.body.appendChild(canvas);\n }\n\n if (allowResize && !initialized) {\n // initialize the size of a user-supplied canvas\n resizer(canvas);\n }\n\n var size = {\n width: canvas.width,\n height: canvas.height\n };\n\n if (worker && !initialized) {\n worker.init(canvas);\n }\n\n initialized = true;\n\n if (worker) {\n canvas.__confetti_initialized = true;\n }\n\n function onResize() {\n if (worker) {\n // TODO this really shouldn't be immediate, because it is expensive\n var obj = {\n getBoundingClientRect: function () {\n if (!isLibCanvas) {\n return canvas.getBoundingClientRect();\n }\n }\n };\n\n resizer(obj);\n\n worker.postMessage({\n resize: {\n width: obj.width,\n height: obj.height\n }\n });\n return;\n }\n\n // don't actually query the size here, since this\n // can execute frequently and rapidly\n size.width = size.height = null;\n }\n\n function done() {\n animationObj = null;\n\n if (allowResize) {\n hasResizeEventRegistered = false;\n global.removeEventListener('resize', onResize);\n }\n\n if (isLibCanvas && canvas) {\n if (document.body.contains(canvas)) {\n document.body.removeChild(canvas); \n }\n canvas = null;\n initialized = false;\n }\n }\n\n if (allowResize && !hasResizeEventRegistered) {\n hasResizeEventRegistered = true;\n global.addEventListener('resize', onResize, false);\n }\n\n if (worker) {\n return worker.fire(options, size, done);\n }\n\n return fireLocal(options, size, done);\n }\n\n fire.reset = function () {\n if (worker) {\n worker.reset();\n }\n\n if (animationObj) {\n animationObj.reset();\n }\n };\n\n return fire;\n }\n\n // Make default export lazy to defer worker creation until called.\n var defaultFire;\n function getDefaultFire() {\n if (!defaultFire) {\n defaultFire = confettiCannon(null, { useWorker: true, resize: true });\n }\n return defaultFire;\n }\n\n function transformPath2D(pathString, pathMatrix, x, y, scaleX, scaleY, rotation) {\n var path2d = new Path2D(pathString);\n\n var t1 = new Path2D();\n t1.addPath(path2d, new DOMMatrix(pathMatrix));\n\n var t2 = new Path2D();\n // see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix/DOMMatrix\n t2.addPath(t1, new DOMMatrix([\n Math.cos(rotation) * scaleX,\n Math.sin(rotation) * scaleX,\n -Math.sin(rotation) * scaleY,\n Math.cos(rotation) * scaleY,\n x,\n y\n ]));\n\n return t2;\n }\n\n function shapeFromPath(pathData) {\n if (!canUsePaths) {\n throw new Error('path confetti are not supported in this browser');\n }\n\n var path, matrix;\n\n if (typeof pathData === 'string') {\n path = pathData;\n } else {\n path = pathData.path;\n matrix = pathData.matrix;\n }\n\n var path2d = new Path2D(path);\n var tempCanvas = document.createElement('canvas');\n var tempCtx = tempCanvas.getContext('2d');\n\n if (!matrix) {\n // attempt to figure out the width of the path, up to 1000x1000\n var maxSize = 1000;\n var minX = maxSize;\n var minY = maxSize;\n var maxX = 0;\n var maxY = 0;\n var width, height;\n\n // do some line skipping... this is faster than checking\n // every pixel and will be mostly still correct\n for (var x = 0; x < maxSize; x += 2) {\n for (var y = 0; y < maxSize; y += 2) {\n if (tempCtx.isPointInPath(path2d, x, y, 'nonzero')) {\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x);\n maxY = Math.max(maxY, y);\n }\n }\n }\n\n width = maxX - minX;\n height = maxY - minY;\n\n var maxDesiredSize = 10;\n var scale = Math.min(maxDesiredSize/width, maxDesiredSize/height);\n\n matrix = [\n scale, 0, 0, scale,\n -Math.round((width/2) + minX) * scale,\n -Math.round((height/2) + minY) * scale\n ];\n }\n\n return {\n type: 'path',\n path: path,\n matrix: matrix\n };\n }\n\n function shapeFromText(textData) {\n var text,\n scalar = 1,\n color = '#000000',\n // see https://nolanlawson.com/2022/04/08/the-struggle-of-using-native-emoji-on-the-web/\n fontFamily = '\"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\", \"EmojiOne Color\", \"Android Emoji\", \"Twemoji Mozilla\", \"system emoji\", sans-serif';\n\n if (typeof textData === 'string') {\n text = textData;\n } else {\n text = textData.text;\n scalar = 'scalar' in textData ? textData.scalar : scalar;\n fontFamily = 'fontFamily' in textData ? textData.fontFamily : fontFamily;\n color = 'color' in textData ? textData.color : color;\n }\n\n // all other confetti are 10 pixels,\n // so this pixel size is the de-facto 100% scale confetti\n var fontSize = 10 * scalar;\n var font = '' + fontSize + 'px ' + fontFamily;\n\n var canvas = new OffscreenCanvas(fontSize, fontSize);\n var ctx = canvas.getContext('2d');\n\n ctx.font = font;\n var size = ctx.measureText(text);\n var width = Math.ceil(size.actualBoundingBoxRight + size.actualBoundingBoxLeft);\n var height = Math.ceil(size.actualBoundingBoxAscent + size.actualBoundingBoxDescent);\n\n var padding = 2;\n var x = size.actualBoundingBoxLeft + padding;\n var y = size.actualBoundingBoxAscent + padding;\n width += padding + padding;\n height += padding + padding;\n\n canvas = new OffscreenCanvas(width, height);\n ctx = canvas.getContext('2d');\n ctx.font = font;\n ctx.fillStyle = color;\n\n ctx.fillText(text, x, y);\n\n var scale = 1 / scalar;\n\n return {\n type: 'bitmap',\n // TODO these probably need to be transfered for workers\n bitmap: canvas.transferToImageBitmap(),\n matrix: [scale, 0, 0, scale, -width * scale / 2, -height * scale / 2]\n };\n }\n\n module.exports = function() {\n return getDefaultFire().apply(this, arguments);\n };\n module.exports.reset = function() {\n getDefaultFire().reset();\n };\n module.exports.create = confettiCannon;\n module.exports.shapeFromPath = shapeFromPath;\n module.exports.shapeFromText = shapeFromText;\n}((function () {\n if (typeof window !== 'undefined') {\n return window;\n }\n\n if (typeof self !== 'undefined') {\n return self;\n }\n\n return this || {};\n})(), module, false));\n\n// end source content\n\nexport default module.exports;\nexport var create = module.exports.create;\n", "import confetti from 'canvas-confetti'\n\nexport function fireworks(): void {\n const duration = 3 * 1000\n const animationEnd = Date.now() + duration\n const defaults = { startVelocity: 30, spread: 360, ticks: 60, zIndex: 9999 }\n\n function randomInRange(min: number, max: number) {\n return Math.random() * (max - min) + min\n }\n\n const interval = setInterval(function () {\n var timeLeft = animationEnd - Date.now()\n\n if (timeLeft <= 0) return clearInterval(interval)\n\n const particleCount = 50 * (timeLeft / duration)\n // since particles fall down, start a bit higher than random\n confetti({\n ...defaults,\n particleCount,\n origin: { x: randomInRange(0.1, 0.3), y: Math.random() - 0.2 },\n })\n confetti({\n ...defaults,\n particleCount,\n origin: { x: randomInRange(0.7, 0.9), y: Math.random() - 0.2 },\n })\n }, 250)\n}\n\nexport function stars(origin?: any): void {\n const defaults = {\n spread: 360,\n ticks: 50,\n gravity: 0,\n decay: 0.94,\n startVelocity: 30,\n colors: ['ffe400', 'ffbd00', 'e89400', 'ffca6c', 'fdffb8'],\n zIndex: 9999,\n }\n\n function shoot() {\n confetti({\n ...defaults,\n particleCount: 40,\n scalar: 1.2,\n shapes: ['star'],\n })\n\n confetti({\n ...defaults,\n particleCount: 10,\n scalar: 0.75,\n shapes: ['circle'],\n })\n }\n\n setTimeout(shoot, 0)\n setTimeout(shoot, 100)\n setTimeout(shoot, 200)\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { fireworks, stars } from '../fireworks'\n\nexport default class extends Controller {\n static values = {\n remove: { type: Boolean, default: true },\n type: { type: String, default: 'fireworks' },\n }\n declare removeValue: boolean\n declare typeValue: 'fireworks' | 'stars'\n\n connect(): void {\n if (this.typeValue === 'stars') {\n stars()\n } else {\n fireworks()\n }\n\n if (this.removeValue) {\n this.element.remove()\n }\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['source', 'target']\n\n connect() {\n const source = this.sourceTarget\n const target = this.targetTarget\n const groups = target.querySelectorAll(`optgroup`)\n this.options = Array.from(groups).map(group => {\n const label = group.getAttribute('label').trim()\n const options = Array.from(group.querySelectorAll('option'))\n return { label, options }\n })\n this.removeTargetGroups()\n\n if (source.selectedIndex > -1) {\n this.updateOptionsFromSource()\n }\n }\n\n sourceChanged(_event) {\n this.removeCurrentOptions()\n this.updateOptionsFromSource()\n }\n\n updateOptionsFromSource() {\n const source = this.sourceTarget\n const target = this.targetTarget\n const label = source.options[source.selectedIndex].text.trim()\n const selectedOption = this.options.find(group => group.label === label)\n if (!selectedOption) return\n\n const options = selectedOption.options\n\n options.forEach(option => {\n const optionElement = document.createElement('option')\n optionElement.value = option.value\n optionElement.text = option.text\n optionElement.selected = option.selected\n target.appendChild(optionElement)\n })\n }\n\n removeTargetGroups() {\n const target = this.targetTarget\n const groups = target.querySelectorAll(`optgroup`)\n groups.forEach(group => group.remove())\n }\n\n removeCurrentOptions() {\n const target = this.targetTarget\n const options = target.querySelectorAll('option:not([value=\"\"])')\n options.forEach(option => option.remove())\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport class NestedFormController extends Controller {\n targetTarget?: HTMLElement\n templateTarget?: HTMLElement\n wrapperSelectorValue?: string\n\n static targets = ['target', 'template']\n static values = {\n wrapperSelector: {\n type: String,\n default: '.nested-form-wrapper',\n },\n }\n\n add(e: Event): void {\n e.preventDefault()\n\n const count =\n document.getElementsByClassName('options-fields-wrapper').length + 1\n\n // @ts-ignore\n const content = this.templateTarget.innerHTML\n .replace(/NEW_RECORD/g, new Date().getTime().toString())\n .replace(/Option/g, 'Option ' + count)\n\n this.targetTarget?.insertAdjacentHTML('beforebegin', content)\n\n const event = new CustomEvent('rails-nested-form:add', { bubbles: true })\n this.element.dispatchEvent(event)\n }\n\n remove(e: Event): void {\n e.preventDefault()\n\n if (!this.wrapperSelectorValue) return\n\n const wrapper: HTMLElement | null = (e.target as HTMLElement).closest(\n this.wrapperSelectorValue\n )\n\n if (wrapper?.dataset.newRecord === 'true') {\n wrapper.remove()\n } else {\n if (wrapper) wrapper.style.display = 'none'\n\n const input: HTMLInputElement | null | undefined = wrapper?.querySelector(\n \"input[name*='_destroy']\"\n )\n if (input) input.value = '1'\n }\n\n const fields = Array.from(\n document.getElementsByClassName('options-fields-wrapper')\n )\n\n for (const [idx, field] of fields.entries()) {\n const count = idx + 1\n const label = field.querySelector('label')\n\n if (label) label.innerHTML = 'Option ' + count\n }\n\n const event = new CustomEvent('rails-nested-form:remove', { bubbles: true })\n this.element.dispatchEvent(event)\n }\n}\n", "(function(prototype) {\n if (typeof prototype.requestSubmit == \"function\") return\n\n prototype.requestSubmit = function(submitter) {\n if (submitter) {\n validateSubmitter(submitter, this)\n submitter.click()\n } else {\n submitter = document.createElement(\"input\")\n submitter.type = \"submit\"\n submitter.hidden = true\n this.appendChild(submitter)\n submitter.click()\n this.removeChild(submitter)\n }\n }\n\n function validateSubmitter(submitter, form) {\n submitter instanceof HTMLElement || raise(TypeError, \"parameter 1 is not of type 'HTMLElement'\")\n submitter.type == \"submit\" || raise(TypeError, \"The specified element is not a submit button\")\n submitter.form == form || raise(DOMException, \"The specified element is not owned by this form element\", \"NotFoundError\")\n }\n\n function raise(errorConstructor, message, name) {\n throw new errorConstructor(\"Failed to execute 'requestSubmit' on 'HTMLFormElement': \" + message + \".\", name)\n }\n})(HTMLFormElement.prototype);\n", "import { Controller } from '@hotwired/stimulus'\nimport { patch } from '@rails/request.js'\nimport 'form-request-submit-polyfill'\n\nexport default class extends Controller<HTMLFormElement> {\n static targets: string[] = ['sendOnEnterButton', 'toggle']\n declare readonly hasSendOnEnterButtonTarget: boolean\n declare readonly sendOnEnterButtonTarget: HTMLButtonElement\n declare readonly sendOnEnterButtonTargets: HTMLButtonElement[]\n declare readonly hasToggleTarget: boolean\n declare readonly toggleTarget: HTMLSpanElement\n declare readonly toggleTargets: HTMLSpanElement[]\n\n static values = {\n sendOnEnter: { type: Boolean, default: false },\n }\n declare sendOnEnterValue: boolean\n\n connect(): void {\n this.setupSubmitListener()\n this.setupEnterListener()\n }\n\n disconnect(): void {\n this.removeSubmitListener()\n this.removeEnterListener()\n }\n\n sendOnEnterValueChanged(value, previousValue) {\n if (value === previousValue) return\n\n if (value) {\n this.sendOnEnterButtonTarget.classList.add('bg-primary-600')\n this.sendOnEnterButtonTarget.classList.remove(\n 'bg-gray-200',\n 'dark:bg-neutral-700'\n )\n this.toggleTarget.classList.add('translate-x-5')\n this.toggleTarget.classList.remove('translate-x-0')\n } else {\n this.sendOnEnterButtonTarget.classList.remove('bg-primary-600')\n this.sendOnEnterButtonTarget.classList.add(\n 'bg-gray-200',\n 'dark:bg-neutral-700'\n )\n this.toggleTarget.classList.add('translate-x-0')\n this.toggleTarget.classList.remove('translate-x-5')\n }\n\n patch('/account/settings', {\n contentType: 'application/json',\n responseKind: 'json',\n body: {\n user: {\n settings_attributes: {\n send_message_on_enter: value,\n },\n },\n },\n })\n }\n\n reset() {\n this.element.reset()\n }\n\n onSubmitEnd = (event: any): void => {\n if (event.detail.success) {\n this.reset()\n }\n }\n\n setupSubmitListener() {\n this.element.addEventListener('turbo:submit-end', this.onSubmitEnd)\n }\n\n removeSubmitListener() {\n this.element.removeEventListener('turbo:submit-end', this.onSubmitEnd)\n }\n\n toggleSendOnEnter() {\n this.sendOnEnterValue = !this.sendOnEnterValue\n }\n\n onKeyDown = (event: KeyboardEvent): void => {\n if (event.code === 'Enter' && this.sendOnEnterValue) {\n event.preventDefault()\n this.element.requestSubmit()\n }\n }\n\n setupEnterListener() {\n this.element.addEventListener('keydown', this.onKeyDown)\n }\n\n removeEnterListener() {\n this.element.removeEventListener('keydown', this.onKeyDown)\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { post } from '@rails/request.js'\n\nexport default class extends Controller {\n observer?: MutationObserver\n\n observerConfig = {\n attributes: false,\n childList: true,\n subtree: false,\n }\n\n static values = {\n url: String,\n }\n\n declare urlValue: string\n\n connect(): void {\n this.setupObserver()\n }\n\n disconnect(): void {\n this.stopObserver()\n }\n\n private handleMutation: MutationCallback = (mutationList, observer): void => {\n post(this.urlValue, {\n contentType: 'application/json',\n responseKind: 'json',\n body: {},\n })\n }\n\n private setupObserver() {\n this.observer = new MutationObserver(this.handleMutation)\n this.observer.observe(this.element, this.observerConfig)\n }\n\n private stopObserver() {\n this.observer?.disconnect()\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport 'form-request-submit-polyfill'\n\nexport default class extends Controller<HTMLFormElement> {\n static targets = ['cancelButton']\n\n declare readonly cancelButtonTarget: HTMLButtonElement\n declare readonly hasCancelButtonTarget: boolean\n\n connect(): void {\n this.setupSubmitListener()\n this.setupKeydownListener()\n }\n\n disconnect(): void {\n this.removeSubmitListener()\n this.removeKeydownListener()\n }\n\n reset() {\n this.element.reset()\n }\n\n onSubmitEnd = (event: any): void => {\n if (event.detail.success) {\n this.reset()\n }\n }\n\n setupSubmitListener() {\n this.element.addEventListener('turbo:submit-end', this.onSubmitEnd)\n }\n\n removeSubmitListener() {\n this.element.removeEventListener('turbo:submit-end', this.onSubmitEnd)\n }\n\n onKeyDown = (event: KeyboardEvent): void => {\n if (event.code === 'Enter' && !event.shiftKey) {\n event.preventDefault()\n this.element.requestSubmit()\n }\n\n if (event.code === 'Escape' && this.hasCancelButtonTarget) {\n event.preventDefault()\n this.cancelButtonTarget.click()\n }\n }\n\n setupKeydownListener() {\n this.element.addEventListener('keydown', this.onKeyDown)\n }\n\n removeKeydownListener() {\n this.element.removeEventListener('keydown', this.onKeyDown)\n }\n}\n", "/**! \n * hotkeys-js v3.13.9 \n * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. \n * \n * Copyright (c) 2024 kenny wong <wowohoo@qq.com> \n * https://github.com/jaywcjlove/hotkeys-js.git \n * \n * @website: https://jaywcjlove.github.io/hotkeys-js\n \n * Licensed under the MIT license \n */\n\nconst isff = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase().indexOf('firefox') > 0 : false;\n\n// \u7ED1\u5B9A\u4E8B\u4EF6\nfunction addEvent(object, event, method, useCapture) {\n if (object.addEventListener) {\n object.addEventListener(event, method, useCapture);\n } else if (object.attachEvent) {\n object.attachEvent(\"on\".concat(event), method);\n }\n}\nfunction removeEvent(object, event, method, useCapture) {\n if (object.removeEventListener) {\n object.removeEventListener(event, method, useCapture);\n } else if (object.detachEvent) {\n object.detachEvent(\"on\".concat(event), method);\n }\n}\n\n// \u4FEE\u9970\u952E\u8F6C\u6362\u6210\u5BF9\u5E94\u7684\u952E\u7801\nfunction getMods(modifier, key) {\n const mods = key.slice(0, key.length - 1);\n for (let i = 0; i < mods.length; i++) mods[i] = modifier[mods[i].toLowerCase()];\n return mods;\n}\n\n// \u5904\u7406\u4F20\u7684key\u5B57\u7B26\u4E32\u8F6C\u6362\u6210\u6570\u7EC4\nfunction getKeys(key) {\n if (typeof key !== 'string') key = '';\n key = key.replace(/\\s/g, ''); // \u5339\u914D\u4EFB\u4F55\u7A7A\u767D\u5B57\u7B26,\u5305\u62EC\u7A7A\u683C\u3001\u5236\u8868\u7B26\u3001\u6362\u9875\u7B26\u7B49\u7B49\n const keys = key.split(','); // \u540C\u65F6\u8BBE\u7F6E\u591A\u4E2A\u5FEB\u6377\u952E\uFF0C\u4EE5','\u5206\u5272\n let index = keys.lastIndexOf('');\n\n // \u5FEB\u6377\u952E\u53EF\u80FD\u5305\u542B','\uFF0C\u9700\u7279\u6B8A\u5904\u7406\n for (; index >= 0;) {\n keys[index - 1] += ',';\n keys.splice(index, 1);\n index = keys.lastIndexOf('');\n }\n return keys;\n}\n\n// \u6BD4\u8F83\u4FEE\u9970\u952E\u7684\u6570\u7EC4\nfunction compareArray(a1, a2) {\n const arr1 = a1.length >= a2.length ? a1 : a2;\n const arr2 = a1.length >= a2.length ? a2 : a1;\n let isIndex = true;\n for (let i = 0; i < arr1.length; i++) {\n if (arr2.indexOf(arr1[i]) === -1) isIndex = false;\n }\n return isIndex;\n}\n\n// Special Keys\nconst _keyMap = {\n backspace: 8,\n '\u232B': 8,\n tab: 9,\n clear: 12,\n enter: 13,\n '\u21A9': 13,\n return: 13,\n esc: 27,\n escape: 27,\n space: 32,\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n del: 46,\n delete: 46,\n ins: 45,\n insert: 45,\n home: 36,\n end: 35,\n pageup: 33,\n pagedown: 34,\n capslock: 20,\n num_0: 96,\n num_1: 97,\n num_2: 98,\n num_3: 99,\n num_4: 100,\n num_5: 101,\n num_6: 102,\n num_7: 103,\n num_8: 104,\n num_9: 105,\n num_multiply: 106,\n num_add: 107,\n num_enter: 108,\n num_subtract: 109,\n num_decimal: 110,\n num_divide: 111,\n '\u21EA': 20,\n ',': 188,\n '.': 190,\n '/': 191,\n '`': 192,\n '-': isff ? 173 : 189,\n '=': isff ? 61 : 187,\n ';': isff ? 59 : 186,\n '\\'': 222,\n '[': 219,\n ']': 221,\n '\\\\': 220\n};\n\n// Modifier Keys\nconst _modifier = {\n // shiftKey\n '\u21E7': 16,\n shift: 16,\n // altKey\n '\u2325': 18,\n alt: 18,\n option: 18,\n // ctrlKey\n '\u2303': 17,\n ctrl: 17,\n control: 17,\n // metaKey\n '\u2318': 91,\n cmd: 91,\n command: 91\n};\nconst modifierMap = {\n 16: 'shiftKey',\n 18: 'altKey',\n 17: 'ctrlKey',\n 91: 'metaKey',\n shiftKey: 16,\n ctrlKey: 17,\n altKey: 18,\n metaKey: 91\n};\nconst _mods = {\n 16: false,\n 18: false,\n 17: false,\n 91: false\n};\nconst _handlers = {};\n\n// F1~F12 special key\nfor (let k = 1; k < 20; k++) {\n _keyMap[\"f\".concat(k)] = 111 + k;\n}\n\nlet _downKeys = []; // \u8BB0\u5F55\u6441\u4E0B\u7684\u7ED1\u5B9A\u952E\nlet winListendFocus = null; // window\u662F\u5426\u5DF2\u7ECF\u76D1\u542C\u4E86focus\u4E8B\u4EF6\nlet _scope = 'all'; // \u9ED8\u8BA4\u70ED\u952E\u8303\u56F4\nconst elementEventMap = new Map(); // \u5DF2\u7ED1\u5B9A\u4E8B\u4EF6\u7684\u8282\u70B9\u8BB0\u5F55\n\n// \u8FD4\u56DE\u952E\u7801\nconst code = x => _keyMap[x.toLowerCase()] || _modifier[x.toLowerCase()] || x.toUpperCase().charCodeAt(0);\nconst getKey = x => Object.keys(_keyMap).find(k => _keyMap[k] === x);\nconst getModifier = x => Object.keys(_modifier).find(k => _modifier[k] === x);\n\n// \u8BBE\u7F6E\u83B7\u53D6\u5F53\u524D\u8303\u56F4\uFF08\u9ED8\u8BA4\u4E3A'\u6240\u6709'\uFF09\nfunction setScope(scope) {\n _scope = scope || 'all';\n}\n// \u83B7\u53D6\u5F53\u524D\u8303\u56F4\nfunction getScope() {\n return _scope || 'all';\n}\n// \u83B7\u53D6\u6441\u4E0B\u7ED1\u5B9A\u952E\u7684\u952E\u503C\nfunction getPressedKeyCodes() {\n return _downKeys.slice(0);\n}\nfunction getPressedKeyString() {\n return _downKeys.map(c => getKey(c) || getModifier(c) || String.fromCharCode(c));\n}\nfunction getAllKeyCodes() {\n const result = [];\n Object.keys(_handlers).forEach(k => {\n _handlers[k].forEach(_ref => {\n let {\n key,\n scope,\n mods,\n shortcut\n } = _ref;\n result.push({\n scope,\n shortcut,\n mods,\n keys: key.split('+').map(v => code(v))\n });\n });\n });\n return result;\n}\n\n// \u8868\u5355\u63A7\u4EF6\u63A7\u4EF6\u5224\u65AD \u8FD4\u56DE Boolean\n// hotkey is effective only when filter return true\nfunction filter(event) {\n const target = event.target || event.srcElement;\n const {\n tagName\n } = target;\n let flag = true;\n const isInput = tagName === 'INPUT' && !['checkbox', 'radio', 'range', 'button', 'file', 'reset', 'submit', 'color'].includes(target.type);\n // ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select>\n if (target.isContentEditable || (isInput || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly) {\n flag = false;\n }\n return flag;\n}\n\n// \u5224\u65AD\u6441\u4E0B\u7684\u952E\u662F\u5426\u4E3A\u67D0\u4E2A\u952E\uFF0C\u8FD4\u56DEtrue\u6216\u8005false\nfunction isPressed(keyCode) {\n if (typeof keyCode === 'string') {\n keyCode = code(keyCode); // \u8F6C\u6362\u6210\u952E\u7801\n }\n return _downKeys.indexOf(keyCode) !== -1;\n}\n\n// \u5FAA\u73AF\u5220\u9664handlers\u4E2D\u7684\u6240\u6709 scope(\u8303\u56F4)\nfunction deleteScope(scope, newScope) {\n let handlers;\n let i;\n\n // \u6CA1\u6709\u6307\u5B9Ascope\uFF0C\u83B7\u53D6scope\n if (!scope) scope = getScope();\n for (const key in _handlers) {\n if (Object.prototype.hasOwnProperty.call(_handlers, key)) {\n handlers = _handlers[key];\n for (i = 0; i < handlers.length;) {\n if (handlers[i].scope === scope) {\n const deleteItems = handlers.splice(i, 1);\n deleteItems.forEach(_ref2 => {\n let {\n element\n } = _ref2;\n return removeKeyEvent(element);\n });\n } else {\n i++;\n }\n }\n }\n }\n\n // \u5982\u679Cscope\u88AB\u5220\u9664\uFF0C\u5C06scope\u91CD\u7F6E\u4E3Aall\n if (getScope() === scope) setScope(newScope || 'all');\n}\n\n// \u6E05\u9664\u4FEE\u9970\u952E\nfunction clearModifier(event) {\n let key = event.keyCode || event.which || event.charCode;\n const i = _downKeys.indexOf(key);\n\n // \u4ECE\u5217\u8868\u4E2D\u6E05\u9664\u6309\u538B\u8FC7\u7684\u952E\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n // \u7279\u6B8A\u5904\u7406 cmmand \u952E\uFF0C\u5728 cmmand \u7EC4\u5408\u5FEB\u6377\u952E keyup \u53EA\u6267\u884C\u4E00\u6B21\u7684\u95EE\u9898\n if (event.key && event.key.toLowerCase() === 'meta') {\n _downKeys.splice(0, _downKeys.length);\n }\n\n // \u4FEE\u9970\u952E shiftKey altKey ctrlKey (command||metaKey) \u6E05\u9664\n if (key === 93 || key === 224) key = 91;\n if (key in _mods) {\n _mods[key] = false;\n\n // \u5C06\u4FEE\u9970\u952E\u91CD\u7F6E\u4E3Afalse\n for (const k in _modifier) if (_modifier[k] === key) hotkeys[k] = false;\n }\n}\nfunction unbind(keysInfo) {\n // unbind(), unbind all keys\n if (typeof keysInfo === 'undefined') {\n Object.keys(_handlers).forEach(key => {\n Array.isArray(_handlers[key]) && _handlers[key].forEach(info => eachUnbind(info));\n delete _handlers[key];\n });\n removeKeyEvent(null);\n } else if (Array.isArray(keysInfo)) {\n // support like : unbind([{key: 'ctrl+a', scope: 's1'}, {key: 'ctrl-a', scope: 's2', splitKey: '-'}])\n keysInfo.forEach(info => {\n if (info.key) eachUnbind(info);\n });\n } else if (typeof keysInfo === 'object') {\n // support like unbind({key: 'ctrl+a, ctrl+b', scope:'abc'})\n if (keysInfo.key) eachUnbind(keysInfo);\n } else if (typeof keysInfo === 'string') {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n // support old method\n // eslint-disable-line\n let [scope, method] = args;\n if (typeof scope === 'function') {\n method = scope;\n scope = '';\n }\n eachUnbind({\n key: keysInfo,\n scope,\n method,\n splitKey: '+'\n });\n }\n}\n\n// \u89E3\u9664\u7ED1\u5B9A\u67D0\u4E2A\u8303\u56F4\u7684\u5FEB\u6377\u952E\nconst eachUnbind = _ref3 => {\n let {\n key,\n scope,\n method,\n splitKey = '+'\n } = _ref3;\n const multipleKeys = getKeys(key);\n multipleKeys.forEach(originKey => {\n const unbindKeys = originKey.split(splitKey);\n const len = unbindKeys.length;\n const lastKey = unbindKeys[len - 1];\n const keyCode = lastKey === '*' ? '*' : code(lastKey);\n if (!_handlers[keyCode]) return;\n // \u5224\u65AD\u662F\u5426\u4F20\u5165\u8303\u56F4\uFF0C\u6CA1\u6709\u5C31\u83B7\u53D6\u8303\u56F4\n if (!scope) scope = getScope();\n const mods = len > 1 ? getMods(_modifier, unbindKeys) : [];\n const unbindElements = [];\n _handlers[keyCode] = _handlers[keyCode].filter(record => {\n // \u901A\u8FC7\u51FD\u6570\u5224\u65AD\uFF0C\u662F\u5426\u89E3\u9664\u7ED1\u5B9A\uFF0C\u51FD\u6570\u76F8\u7B49\u76F4\u63A5\u8FD4\u56DE\n const isMatchingMethod = method ? record.method === method : true;\n const isUnbind = isMatchingMethod && record.scope === scope && compareArray(record.mods, mods);\n if (isUnbind) unbindElements.push(record.element);\n return !isUnbind;\n });\n unbindElements.forEach(element => removeKeyEvent(element));\n });\n};\n\n// \u5BF9\u76D1\u542C\u5BF9\u5E94\u5FEB\u6377\u952E\u7684\u56DE\u8C03\u51FD\u6570\u8FDB\u884C\u5904\u7406\nfunction eventHandler(event, handler, scope, element) {\n if (handler.element !== element) {\n return;\n }\n let modifiersMatch;\n\n // \u770B\u5B83\u662F\u5426\u5728\u5F53\u524D\u8303\u56F4\n if (handler.scope === scope || handler.scope === 'all') {\n // \u68C0\u67E5\u662F\u5426\u5339\u914D\u4FEE\u9970\u7B26\uFF08\u5982\u679C\u6709\u8FD4\u56DEtrue\uFF09\n modifiersMatch = handler.mods.length > 0;\n for (const y in _mods) {\n if (Object.prototype.hasOwnProperty.call(_mods, y)) {\n if (!_mods[y] && handler.mods.indexOf(+y) > -1 || _mods[y] && handler.mods.indexOf(+y) === -1) {\n modifiersMatch = false;\n }\n }\n }\n\n // \u8C03\u7528\u5904\u7406\u7A0B\u5E8F\uFF0C\u5982\u679C\u662F\u4FEE\u9970\u952E\u4E0D\u505A\u5904\u7406\n if (handler.mods.length === 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91] || modifiersMatch || handler.shortcut === '*') {\n handler.keys = [];\n handler.keys = handler.keys.concat(_downKeys);\n if (handler.method(event, handler) === false) {\n if (event.preventDefault) event.preventDefault();else event.returnValue = false;\n if (event.stopPropagation) event.stopPropagation();\n if (event.cancelBubble) event.cancelBubble = true;\n }\n }\n }\n}\n\n// \u5904\u7406keydown\u4E8B\u4EF6\nfunction dispatch(event, element) {\n const asterisk = _handlers['*'];\n let key = event.keyCode || event.which || event.charCode;\n\n // \u8868\u5355\u63A7\u4EF6\u8FC7\u6EE4 \u9ED8\u8BA4\u8868\u5355\u63A7\u4EF6\u4E0D\u89E6\u53D1\u5FEB\u6377\u952E\n if (!hotkeys.filter.call(this, event)) return;\n\n // Gecko(Firefox)\u7684command\u952E\u503C224\uFF0C\u5728Webkit(Chrome)\u4E2D\u4FDD\u6301\u4E00\u81F4\n // Webkit\u5DE6\u53F3 command \u952E\u503C\u4E0D\u4E00\u6837\n if (key === 93 || key === 224) key = 91;\n\n /**\n * Collect bound keys\n * If an Input Method Editor is processing key input and the event is keydown, return 229.\n * https://stackoverflow.com/questions/25043934/is-it-ok-to-ignore-keydown-events-with-keycode-229\n * http://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html\n */\n if (_downKeys.indexOf(key) === -1 && key !== 229) _downKeys.push(key);\n /**\n * Jest test cases are required.\n * ===============================\n */\n ['metaKey', 'ctrlKey', 'altKey', 'shiftKey'].forEach(keyName => {\n const keyNum = modifierMap[keyName];\n if (event[keyName] && _downKeys.indexOf(keyNum) === -1) {\n _downKeys.push(keyNum);\n } else if (!event[keyName] && _downKeys.indexOf(keyNum) > -1) {\n _downKeys.splice(_downKeys.indexOf(keyNum), 1);\n } else if (keyName === 'metaKey' && event[keyName]) {\n // \u5982\u679Ccommand\u88AB\u6309\u4E0B\uFF0C\u90A3\u5C31\u6E05\u7A7A\u6240\u6709\u9664event\u6309\u952E\u5916\u7684\u975E\u88C5\u9970\u952E\u3002\n // \u56E0\u4E3Acommand\u88AB\u6309\u4E0B\u7684\u60C5\u51B5\u4E0B\u975E\u88C5\u9970\u952E\u7684keyup\u6C38\u8FDC\u90FD\u4E0D\u4F1A\u89E6\u53D1\u3002\u8FD9\u662F\u5DF2\u77E5\u7684\u6D4F\u89C8\u5668\u9650\u5236\u3002\n // If command key is pressed, clear all non-decorating keys except for key in event.\n // This is because keyup for a non-decorating key will NEVER be triggered when command is pressed.\n // This is a known browser limitation.\n _downKeys = _downKeys.filter(k => k in modifierMap || k === key);\n }\n });\n /**\n * -------------------------------\n */\n\n if (key in _mods) {\n _mods[key] = true;\n\n // \u5C06\u7279\u6B8A\u5B57\u7B26\u7684key\u6CE8\u518C\u5230 hotkeys \u4E0A\n for (const k in _modifier) {\n if (_modifier[k] === key) hotkeys[k] = true;\n }\n if (!asterisk) return;\n }\n\n // \u5C06 modifierMap \u91CC\u9762\u7684\u4FEE\u9970\u952E\u7ED1\u5B9A\u5230 event \u4E2D\n for (const e in _mods) {\n if (Object.prototype.hasOwnProperty.call(_mods, e)) {\n _mods[e] = event[modifierMap[e]];\n }\n }\n /**\n * https://github.com/jaywcjlove/hotkeys/pull/129\n * This solves the issue in Firefox on Windows where hotkeys corresponding to special characters would not trigger.\n * An example of this is ctrl+alt+m on a Swedish keyboard which is used to type \u03BC.\n * Browser support: https://caniuse.com/#feat=keyboardevent-getmodifierstate\n */\n if (event.getModifierState && !(event.altKey && !event.ctrlKey) && event.getModifierState('AltGraph')) {\n if (_downKeys.indexOf(17) === -1) {\n _downKeys.push(17);\n }\n if (_downKeys.indexOf(18) === -1) {\n _downKeys.push(18);\n }\n _mods[17] = true;\n _mods[18] = true;\n }\n\n // \u83B7\u53D6\u8303\u56F4 \u9ED8\u8BA4\u4E3A `all`\n const scope = getScope();\n // \u5BF9\u4EFB\u4F55\u5FEB\u6377\u952E\u90FD\u9700\u8981\u505A\u7684\u5904\u7406\n if (asterisk) {\n for (let i = 0; i < asterisk.length; i++) {\n if (asterisk[i].scope === scope && (event.type === 'keydown' && asterisk[i].keydown || event.type === 'keyup' && asterisk[i].keyup)) {\n eventHandler(event, asterisk[i], scope, element);\n }\n }\n }\n // key \u4E0D\u5728 _handlers \u4E2D\u8FD4\u56DE\n if (!(key in _handlers)) return;\n const handlerKey = _handlers[key];\n const keyLen = handlerKey.length;\n for (let i = 0; i < keyLen; i++) {\n if (event.type === 'keydown' && handlerKey[i].keydown || event.type === 'keyup' && handlerKey[i].keyup) {\n if (handlerKey[i].key) {\n const record = handlerKey[i];\n const {\n splitKey\n } = record;\n const keyShortcut = record.key.split(splitKey);\n const _downKeysCurrent = []; // \u8BB0\u5F55\u5F53\u524D\u6309\u952E\u952E\u503C\n for (let a = 0; a < keyShortcut.length; a++) {\n _downKeysCurrent.push(code(keyShortcut[a]));\n }\n if (_downKeysCurrent.sort().join('') === _downKeys.sort().join('')) {\n // \u627E\u5230\u5904\u7406\u5185\u5BB9\n eventHandler(event, record, scope, element);\n }\n }\n }\n }\n}\nfunction hotkeys(key, option, method) {\n _downKeys = [];\n const keys = getKeys(key); // \u9700\u8981\u5904\u7406\u7684\u5FEB\u6377\u952E\u5217\u8868\n let mods = [];\n let scope = 'all'; // scope\u9ED8\u8BA4\u4E3Aall\uFF0C\u6240\u6709\u8303\u56F4\u90FD\u6709\u6548\n let element = document; // \u5FEB\u6377\u952E\u4E8B\u4EF6\u7ED1\u5B9A\u8282\u70B9\n let i = 0;\n let keyup = false;\n let keydown = true;\n let splitKey = '+';\n let capture = false;\n let single = false; // \u5355\u4E2Acallback\n\n // \u5BF9\u4E3A\u8BBE\u5B9A\u8303\u56F4\u7684\u5224\u65AD\n if (method === undefined && typeof option === 'function') {\n method = option;\n }\n if (Object.prototype.toString.call(option) === '[object Object]') {\n if (option.scope) scope = option.scope; // eslint-disable-line\n if (option.element) element = option.element; // eslint-disable-line\n if (option.keyup) keyup = option.keyup; // eslint-disable-line\n if (option.keydown !== undefined) keydown = option.keydown; // eslint-disable-line\n if (option.capture !== undefined) capture = option.capture; // eslint-disable-line\n if (typeof option.splitKey === 'string') splitKey = option.splitKey; // eslint-disable-line\n if (option.single === true) single = true; // eslint-disable-line\n }\n if (typeof option === 'string') scope = option;\n\n // \u5982\u679C\u53EA\u5141\u8BB8\u5355\u4E2Acallback\uFF0C\u5148unbind\n if (single) unbind(key, scope);\n\n // \u5BF9\u4E8E\u6BCF\u4E2A\u5FEB\u6377\u952E\u8FDB\u884C\u5904\u7406\n for (; i < keys.length; i++) {\n key = keys[i].split(splitKey); // \u6309\u952E\u5217\u8868\n mods = [];\n\n // \u5982\u679C\u662F\u7EC4\u5408\u5FEB\u6377\u952E\u53D6\u5F97\u7EC4\u5408\u5FEB\u6377\u952E\n if (key.length > 1) mods = getMods(_modifier, key);\n\n // \u5C06\u975E\u4FEE\u9970\u952E\u8F6C\u5316\u4E3A\u952E\u7801\n key = key[key.length - 1];\n key = key === '*' ? '*' : code(key); // *\u8868\u793A\u5339\u914D\u6240\u6709\u5FEB\u6377\u952E\n\n // \u5224\u65ADkey\u662F\u5426\u5728_handlers\u4E2D\uFF0C\u4E0D\u5728\u5C31\u8D4B\u4E00\u4E2A\u7A7A\u6570\u7EC4\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({\n keyup,\n keydown,\n scope,\n mods,\n shortcut: keys[i],\n method,\n key: keys[i],\n splitKey,\n element\n });\n }\n // \u5728\u5168\u5C40document\u4E0A\u8BBE\u7F6E\u5FEB\u6377\u952E\n if (typeof element !== 'undefined' && window) {\n if (!elementEventMap.has(element)) {\n const keydownListener = function () {\n let event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.event;\n return dispatch(event, element);\n };\n const keyupListenr = function () {\n let event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.event;\n dispatch(event, element);\n clearModifier(event);\n };\n elementEventMap.set(element, {\n keydownListener,\n keyupListenr,\n capture\n });\n addEvent(element, 'keydown', keydownListener, capture);\n addEvent(element, 'keyup', keyupListenr, capture);\n }\n if (!winListendFocus) {\n const listener = () => {\n _downKeys = [];\n };\n winListendFocus = {\n listener,\n capture\n };\n addEvent(window, 'focus', listener, capture);\n }\n }\n}\nfunction trigger(shortcut) {\n let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';\n Object.keys(_handlers).forEach(key => {\n const dataList = _handlers[key].filter(item => item.scope === scope && item.shortcut === shortcut);\n dataList.forEach(data => {\n if (data && data.method) {\n data.method();\n }\n });\n });\n}\n\n// \u9500\u6BC1\u4E8B\u4EF6,unbind\u4E4B\u540E\u5224\u65ADelement\u4E0A\u662F\u5426\u8FD8\u6709\u952E\u76D8\u5FEB\u6377\u952E\uFF0C\u5982\u679C\u6CA1\u6709\u79FB\u9664\u76D1\u542C\nfunction removeKeyEvent(element) {\n const values = Object.values(_handlers).flat();\n const findindex = values.findIndex(_ref4 => {\n let {\n element: el\n } = _ref4;\n return el === element;\n });\n if (findindex < 0) {\n const {\n keydownListener,\n keyupListenr,\n capture\n } = elementEventMap.get(element) || {};\n if (keydownListener && keyupListenr) {\n removeEvent(element, 'keyup', keyupListenr, capture);\n removeEvent(element, 'keydown', keydownListener, capture);\n elementEventMap.delete(element);\n }\n }\n if (values.length <= 0 || elementEventMap.size <= 0) {\n // \u79FB\u9664\u6240\u6709\u7684\u5143\u7D20\u4E0A\u7684\u76D1\u542C\n const eventKeys = Object.keys(elementEventMap);\n eventKeys.forEach(el => {\n const {\n keydownListener,\n keyupListenr,\n capture\n } = elementEventMap.get(el) || {};\n if (keydownListener && keyupListenr) {\n removeEvent(el, 'keyup', keyupListenr, capture);\n removeEvent(el, 'keydown', keydownListener, capture);\n elementEventMap.delete(el);\n }\n });\n // \u6E05\u7A7A elementEventMap\n elementEventMap.clear();\n // \u6E05\u7A7A _handlers\n Object.keys(_handlers).forEach(key => delete _handlers[key]);\n // \u79FB\u9664window\u4E0A\u7684focus\u76D1\u542C\n if (winListendFocus) {\n const {\n listener,\n capture\n } = winListendFocus;\n removeEvent(window, 'focus', listener, capture);\n winListendFocus = null;\n }\n }\n}\nconst _api = {\n getPressedKeyString,\n setScope,\n getScope,\n deleteScope,\n getPressedKeyCodes,\n getAllKeyCodes,\n isPressed,\n filter,\n trigger,\n unbind,\n keyMap: _keyMap,\n modifier: _modifier,\n modifierMap\n};\nfor (const a in _api) {\n if (Object.prototype.hasOwnProperty.call(_api, a)) {\n hotkeys[a] = _api[a];\n }\n}\nif (typeof window !== 'undefined') {\n const _hotkeys = window.hotkeys;\n hotkeys.noConflict = deep => {\n if (deep && window.hotkeys === hotkeys) {\n window.hotkeys = _hotkeys;\n }\n return hotkeys;\n };\n window.hotkeys = hotkeys;\n}\n\nexport { hotkeys as default };\n", "/*\nStimulus-Use 0.51.3\n*/\nimport { Controller } from '@hotwired/stimulus';\nimport hotkeys from 'hotkeys-js';\n\nconst method = (controller, methodName) => {\n const method = controller[methodName];\n if (typeof method == 'function') {\n return method;\n }\n else {\n return (...args) => { };\n }\n};\nconst composeEventName = (name, controller, eventPrefix) => {\n let composedName = name;\n if (eventPrefix === true) {\n composedName = `${controller.identifier}:${name}`;\n }\n else if (typeof eventPrefix === 'string') {\n composedName = `${eventPrefix}:${name}`;\n }\n return composedName;\n};\nconst extendedEvent = (type, event, detail) => {\n const { bubbles, cancelable, composed } = event || { bubbles: true, cancelable: true, composed: true };\n if (event) {\n Object.assign(detail, { originalEvent: event });\n }\n const customEvent = new CustomEvent(type, {\n bubbles,\n cancelable,\n composed,\n detail\n });\n return customEvent;\n};\nfunction isElementInViewport(el) {\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n const vertInView = rect.top <= windowHeight && rect.top + rect.height > 0;\n const horInView = rect.left <= windowWidth && rect.left + rect.width > 0;\n return vertInView && horInView;\n}\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\n\nconst defaultOptions$8 = {\n dispatchEvent: true,\n eventPrefix: true,\n visibleAttribute: 'isVisible'\n};\nconst useIntersection = (composableController, options = {}) => {\n const controller = composableController;\n const { dispatchEvent, eventPrefix, visibleAttribute } = Object.assign({}, defaultOptions$8, options);\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n if (!controller.intersectionElements)\n controller.intersectionElements = [];\n controller.intersectionElements.push(targetElement);\n const callback = (entries) => {\n const [entry] = entries;\n if (entry.isIntersecting) {\n dispatchAppear(entry);\n }\n else if (targetElement.hasAttribute(visibleAttribute)) {\n dispatchDisappear(entry);\n }\n };\n const dispatchAppear = (entry) => {\n targetElement.setAttribute(visibleAttribute, 'true');\n method(controller, 'appear').call(controller, entry);\n if (dispatchEvent) {\n const eventName = composeEventName('appear', controller, eventPrefix);\n const appearEvent = extendedEvent(eventName, null, { controller, entry });\n targetElement.dispatchEvent(appearEvent);\n }\n };\n const dispatchDisappear = (entry) => {\n targetElement.removeAttribute(visibleAttribute);\n method(controller, 'disappear').call(controller, entry);\n if (dispatchEvent) {\n const eventName = composeEventName('disappear', controller, eventPrefix);\n const disappearEvent = extendedEvent(eventName, null, { controller, entry });\n targetElement.dispatchEvent(disappearEvent);\n }\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observer = new IntersectionObserver(callback, options);\n const observe = () => {\n observer.observe(targetElement);\n };\n const unobserve = () => {\n observer.unobserve(targetElement);\n };\n const noneVisible = () => {\n return controller.intersectionElements.filter(element => element.hasAttribute(visibleAttribute)).length === 0;\n };\n const oneVisible = () => {\n return controller.intersectionElements.filter(element => element.hasAttribute(visibleAttribute)).length === 1;\n };\n const atLeastOneVisible = () => {\n return controller.intersectionElements.some(element => element.hasAttribute(visibleAttribute));\n };\n const allVisible = () => {\n return controller.intersectionElements.every(element => element.hasAttribute(visibleAttribute));\n };\n const isVisible = allVisible;\n Object.assign(controller, {\n isVisible,\n noneVisible,\n oneVisible,\n atLeastOneVisible,\n allVisible,\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [observe, unobserve];\n};\n\nclass IntersectionComposableController extends Controller {\n}\nclass IntersectionController extends IntersectionComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useIntersection(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nconst useLazyLoad = (controller, options) => {\n const callback = (entries) => {\n const [entry] = entries;\n if (entry.isIntersecting && !controller.isLoaded) {\n handleAppear();\n }\n };\n const handleAppear = (entry) => {\n const src = controller.data.get('src');\n if (!src)\n return;\n const imageElement = controller.element;\n controller.isLoading = true;\n method(controller, 'loading').call(controller, src);\n imageElement.onload = () => {\n handleLoaded(src);\n };\n imageElement.src = src;\n };\n const handleLoaded = (src) => {\n controller.isLoading = false;\n controller.isLoaded = true;\n method(controller, 'loaded').call(controller, src);\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observer = new IntersectionObserver(callback, options);\n const observe = () => {\n observer.observe(controller.element);\n };\n const unobserve = () => {\n observer.unobserve(controller.element);\n };\n Object.assign(controller, {\n isVisible: false,\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [observe, unobserve];\n};\n\nclass LazyLoadComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.isLoading = false;\n this.isLoaded = false;\n }\n}\nclass LazyLoadController extends LazyLoadComposableController {\n constructor(context) {\n super(context);\n this.options = { rootMargin: '10%' };\n requestAnimationFrame(() => {\n const [observe, unobserve] = useLazyLoad(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nconst defaultOptions$7 = {\n dispatchEvent: true,\n eventPrefix: true\n};\nconst useResize = (composableController, options = {}) => {\n const controller = composableController;\n const { dispatchEvent, eventPrefix } = Object.assign({}, defaultOptions$7, options);\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n const callback = (entries) => {\n const [entry] = entries;\n method(controller, 'resize').call(controller, entry.contentRect);\n if (dispatchEvent) {\n const eventName = composeEventName('resize', controller, eventPrefix);\n const appearEvent = extendedEvent(eventName, null, {\n controller,\n entry\n });\n targetElement.dispatchEvent(appearEvent);\n }\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observer = new ResizeObserver(callback);\n const observe = () => {\n observer.observe(targetElement);\n };\n const unobserve = () => {\n observer.unobserve(targetElement);\n };\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [observe, unobserve];\n};\n\nclass ResizeComposableController extends Controller {\n}\nclass ResizeController extends ResizeComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useResize(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nconst defaultOptions$6 = {\n events: ['click', 'touchend'],\n onlyVisible: true,\n dispatchEvent: true,\n eventPrefix: true\n};\nconst useClickOutside = (composableController, options = {}) => {\n const controller = composableController;\n const { onlyVisible, dispatchEvent, events, eventPrefix } = Object.assign({}, defaultOptions$6, options);\n const onEvent = (event) => {\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n if (targetElement.contains(event.target) || (!isElementInViewport(targetElement) && onlyVisible)) {\n return;\n }\n if (controller.clickOutside) {\n controller.clickOutside(event);\n }\n if (dispatchEvent) {\n const eventName = composeEventName('click:outside', controller, eventPrefix);\n const clickOutsideEvent = extendedEvent(eventName, event, { controller });\n targetElement.dispatchEvent(clickOutsideEvent);\n }\n };\n const observe = () => {\n events === null || events === void 0 ? void 0 : events.forEach(event => {\n window.addEventListener(event, onEvent, false);\n });\n };\n const unobserve = () => {\n events === null || events === void 0 ? void 0 : events.forEach(event => {\n window.removeEventListener(event, onEvent, false);\n });\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [observe, unobserve];\n};\n\nclass ClickOutsideComposableController extends Controller {\n}\nclass ClickOutsideController extends ClickOutsideComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useClickOutside(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\n\nconst defaultOptions$5 = {\n debug: false,\n logger: console,\n dispatchEvent: true,\n eventPrefix: true\n};\nclass StimulusUse {\n constructor(controller, options = {}) {\n var _a, _b, _c;\n this.log = (functionName, args) => {\n if (!this.debug)\n return;\n this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${functionName}`, 'color: #3B82F6', 'color: unset');\n this.logger.log(Object.assign({ controllerId: this.controllerId }, args));\n this.logger.groupEnd();\n };\n this.warn = (message) => {\n this.logger.warn(`%c${this.controller.identifier} %c${message}`, 'color: #3B82F6; font-weight: bold', 'color: unset');\n };\n this.dispatch = (eventName, details = {}) => {\n if (this.dispatchEvent) {\n const { event } = details, eventDetails = __rest(details, [\"event\"]);\n const customEvent = this.extendedEvent(eventName, event || null, eventDetails);\n this.targetElement.dispatchEvent(customEvent);\n this.log('dispatchEvent', Object.assign({ eventName: customEvent.type }, eventDetails));\n }\n };\n this.call = (methodName, args = {}) => {\n const method = this.controller[methodName];\n if (typeof method == 'function') {\n return method.call(this.controller, args);\n }\n };\n this.extendedEvent = (name, event, detail) => {\n const { bubbles, cancelable, composed } = event || { bubbles: true, cancelable: true, composed: true };\n if (event) {\n Object.assign(detail, { originalEvent: event });\n }\n const customEvent = new CustomEvent(this.composeEventName(name), {\n bubbles,\n cancelable,\n composed,\n detail\n });\n return customEvent;\n };\n this.composeEventName = (name) => {\n let composedName = name;\n if (this.eventPrefix === true) {\n composedName = `${this.controller.identifier}:${name}`;\n }\n else if (typeof this.eventPrefix === 'string') {\n composedName = `${this.eventPrefix}:${name}`;\n }\n return composedName;\n };\n this.debug = (_b = (_a = options === null || options === void 0 ? void 0 : options.debug) !== null && _a !== void 0 ? _a : controller.application.stimulusUseDebug) !== null && _b !== void 0 ? _b : defaultOptions$5.debug;\n this.logger = (_c = options === null || options === void 0 ? void 0 : options.logger) !== null && _c !== void 0 ? _c : defaultOptions$5.logger;\n this.controller = controller;\n this.controllerId = controller.element.id || controller.element.dataset.id;\n this.targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n const { dispatchEvent, eventPrefix } = Object.assign({}, defaultOptions$5, options);\n Object.assign(this, { dispatchEvent, eventPrefix });\n this.controllerInitialize = controller.initialize.bind(controller);\n this.controllerConnect = controller.connect.bind(controller);\n this.controllerDisconnect = controller.disconnect.bind(controller);\n }\n}\n\nconst defaultOptions$4 = {\n eventPrefix: true,\n bubbles: true,\n cancelable: true\n};\nclass UseDispatch extends StimulusUse {\n constructor(controller, options = {}) {\n var _a, _b, _c, _d;\n super(controller, options);\n this.dispatch = (eventName, detail = {}) => {\n const { controller, targetElement, eventPrefix, bubbles, cancelable, log, warn } = this;\n Object.assign(detail, { controller });\n const eventNameWithPrefix = composeEventName(eventName, this.controller, eventPrefix);\n const event = new CustomEvent(eventNameWithPrefix, {\n detail,\n bubbles,\n cancelable\n });\n targetElement.dispatchEvent(event);\n warn('`useDispatch()` is deprecated. Please use the built-in `this.dispatch()` function from Stimulus. You can find more information on how to upgrade at: https://stimulus-use.github.io/stimulus-use/#/use-dispatch');\n log('dispatch', { eventName: eventNameWithPrefix, detail, bubbles, cancelable });\n return event;\n };\n this.targetElement = (_a = options.element) !== null && _a !== void 0 ? _a : controller.element;\n this.eventPrefix = (_b = options.eventPrefix) !== null && _b !== void 0 ? _b : defaultOptions$4.eventPrefix;\n this.bubbles = (_c = options.bubbles) !== null && _c !== void 0 ? _c : defaultOptions$4.bubbles;\n this.cancelable = (_d = options.cancelable) !== null && _d !== void 0 ? _d : defaultOptions$4.cancelable;\n this.enhanceController();\n }\n enhanceController() {\n Object.assign(this.controller, { dispatch: this.dispatch });\n }\n}\nconst useDispatch = (controller, options = {}) => {\n return new UseDispatch(controller, options);\n};\n\nconst defaultOptions$3 = {\n overwriteDispatch: true\n};\nconst useApplication = (controller, options = {}) => {\n const { overwriteDispatch } = Object.assign({}, defaultOptions$3, options);\n Object.defineProperty(controller, 'isPreview', {\n get() {\n return (document.documentElement.hasAttribute('data-turbolinks-preview') ||\n document.documentElement.hasAttribute('data-turbo-preview'));\n }\n });\n Object.defineProperty(controller, 'isConnected', {\n get() {\n return !!Array.from(this.context.module.connectedContexts).find(c => c === this.context);\n }\n });\n Object.defineProperty(controller, 'csrfToken', {\n get() {\n return this.metaValue('csrf-token');\n }\n });\n if (overwriteDispatch) {\n useDispatch(controller, options);\n }\n Object.assign(controller, {\n metaValue(name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`);\n return element && element.getAttribute('content');\n }\n });\n};\n\nclass ApplicationController extends Controller {\n constructor(context) {\n super(context);\n this.isPreview = false;\n this.isConnected = false;\n this.csrfToken = '';\n useApplication(this, this.options);\n }\n}\n\nconst defaultEvents = ['mousemove', 'mousedown', 'resize', 'keydown', 'touchstart', 'wheel'];\nconst oneMinute = 60e3;\nconst defaultOptions$2 = {\n ms: oneMinute,\n initialState: false,\n events: defaultEvents,\n dispatchEvent: true,\n eventPrefix: true\n};\nconst useIdle = (composableController, options = {}) => {\n const controller = composableController;\n const { ms, initialState, events, dispatchEvent, eventPrefix } = Object.assign({}, defaultOptions$2, options);\n let isIdle = initialState;\n let timeout = setTimeout(() => {\n isIdle = true;\n dispatchAway();\n }, ms);\n const dispatchAway = (event) => {\n const eventName = composeEventName('away', controller, eventPrefix);\n controller.isIdle = true;\n method(controller, 'away').call(controller, event);\n if (dispatchEvent) {\n const clickOutsideEvent = extendedEvent(eventName, event || null, { controller });\n controller.element.dispatchEvent(clickOutsideEvent);\n }\n };\n const dispatchBack = (event) => {\n const eventName = composeEventName('back', controller, eventPrefix);\n controller.isIdle = false;\n method(controller, 'back').call(controller, event);\n if (dispatchEvent) {\n const clickOutsideEvent = extendedEvent(eventName, event || null, { controller });\n controller.element.dispatchEvent(clickOutsideEvent);\n }\n };\n const onEvent = (event) => {\n if (isIdle)\n dispatchBack(event);\n isIdle = false;\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n isIdle = true;\n dispatchAway(event);\n }, ms);\n };\n const onVisibility = (event) => {\n if (!document.hidden)\n onEvent(event);\n };\n if (isIdle) {\n dispatchAway();\n }\n else {\n dispatchBack();\n }\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observe = () => {\n events.forEach(event => {\n window.addEventListener(event, onEvent);\n });\n document.addEventListener('visibilitychange', onVisibility);\n };\n const unobserve = () => {\n clearTimeout(timeout);\n events.forEach(event => {\n window.removeEventListener(event, onEvent);\n });\n document.removeEventListener('visibilitychange', onVisibility);\n };\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [observe, unobserve];\n};\n\nclass IdleComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.isIdle = false;\n }\n}\nclass IdleController extends IdleComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useIdle(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nclass UseVisibility extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n this.controller.isVisible = !document.hidden;\n document.addEventListener('visibilitychange', this.handleVisibilityChange);\n this.handleVisibilityChange();\n };\n this.unobserve = () => {\n document.removeEventListener('visibilitychange', this.handleVisibilityChange);\n };\n this.becomesInvisible = (event) => {\n this.controller.isVisible = false;\n this.call('invisible', event);\n this.log('invisible', { isVisible: false });\n this.dispatch('invisible', { event, isVisible: false });\n };\n this.becomesVisible = (event) => {\n this.controller.isVisible = true;\n this.call('visible', event);\n this.log('visible', { isVisible: true });\n this.dispatch('visible', { event, isVisible: true });\n };\n this.handleVisibilityChange = (event) => {\n if (document.hidden) {\n this.becomesInvisible(event);\n }\n else {\n this.becomesVisible(event);\n }\n };\n this.controller = controller;\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controllerDisconnect;\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, { disconnect });\n }\n}\nconst useVisibility = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseVisibility(controller, options);\n return [observer.observe, observer.unobserve];\n};\n\nclass VisibilityComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.isVisible = false;\n }\n}\nclass VisibilityController extends VisibilityComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useVisibility(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nclass UseHover extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n this.targetElement.addEventListener('mouseenter', this.onEnter);\n this.targetElement.addEventListener('mouseleave', this.onLeave);\n };\n this.unobserve = () => {\n this.targetElement.removeEventListener('mouseenter', this.onEnter);\n this.targetElement.removeEventListener('mouseleave', this.onLeave);\n };\n this.onEnter = (event) => {\n this.call('mouseEnter', event);\n this.log('mouseEnter', { hover: true });\n this.dispatch('mouseEnter', { hover: false });\n };\n this.onLeave = (event) => {\n this.call('mouseLeave', event);\n this.log('mouseLeave', { hover: false });\n this.dispatch('mouseLeave', { hover: false });\n };\n this.controller = controller;\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, { disconnect });\n }\n}\nconst useHover = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseHover(controller, options);\n return [observer.observe, observer.unobserve];\n};\n\nclass HoverComposableController extends Controller {\n}\nclass HoverController extends HoverComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useHover(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nclass UseMutation extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n try {\n this.observer.observe(this.targetElement, this.options);\n }\n catch (error) {\n this.controller.application.handleError(error, 'At a minimum, one of childList, attributes, and/or characterData must be true', {});\n }\n };\n this.unobserve = () => {\n this.observer.disconnect();\n };\n this.mutation = (entries) => {\n this.call('mutate', entries);\n this.log('mutate', { entries });\n this.dispatch('mutate', { entries });\n };\n this.targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n this.controller = controller;\n this.options = options;\n this.observer = new MutationObserver(this.mutation);\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, { disconnect });\n }\n}\nconst useMutation = (controller, options = {}) => {\n const observer = new UseMutation(controller, options);\n return [observer.observe, observer.unobserve];\n};\n\nclass MutationComposableController extends Controller {\n}\nclass MutationController extends MutationComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useMutation(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nclass UseTargetMutation extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n this.observer.observe(this.targetElement, {\n subtree: true,\n characterData: true,\n childList: true,\n attributes: true,\n attributeOldValue: true,\n attributeFilter: [this.targetSelector, this.scopedTargetSelector]\n });\n };\n this.unobserve = () => {\n this.observer.disconnect();\n };\n this.mutation = (entries) => {\n for (const mutation of entries) {\n switch (mutation.type) {\n case 'attributes':\n let newValue = mutation.target.getAttribute(mutation.attributeName);\n let oldValue = mutation.oldValue;\n if (mutation.attributeName === this.targetSelector || mutation.attributeName === this.scopedTargetSelector) {\n let oldTargets = this.targetsUsedByThisController(oldValue);\n let newTargets = this.targetsUsedByThisController(newValue);\n let removedTargets = oldTargets.filter(target => !newTargets.includes(target));\n let addedTargets = newTargets.filter(target => !oldTargets.includes(target));\n removedTargets.forEach(target => this.targetRemoved(this.stripIdentifierPrefix(target), mutation.target, 'attributeChange'));\n addedTargets.forEach(target => this.targetAdded(this.stripIdentifierPrefix(target), mutation.target, 'attributeChange'));\n }\n break;\n case 'characterData':\n let nodule = this.findTargetInAncestry(mutation.target);\n if (nodule == null) {\n return;\n }\n else {\n let supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n supportedTargets.forEach((target) => {\n this.targetChanged(this.stripIdentifierPrefix(target), nodule, 'domMutation');\n });\n }\n break;\n case 'childList':\n let { addedNodes, removedNodes } = mutation;\n addedNodes.forEach((node) => this.processNodeDOMMutation(node, this.targetAdded));\n removedNodes.forEach((node) => this.processNodeDOMMutation(node, this.targetRemoved));\n break;\n }\n }\n };\n this.controller = controller;\n this.options = options;\n this.targetElement = controller.element;\n this.identifier = controller.scope.identifier;\n this.identifierPrefix = `${this.identifier}.`;\n this.targetSelector = controller.scope.schema.targetAttribute;\n this.scopedTargetSelector = `data-${this.identifier}-target`;\n this.targets = options.targets || controller.constructor.targets;\n this.prefixedTargets = this.targets.map(target => `${this.identifierPrefix}${target}`);\n this.observer = new MutationObserver(this.mutation);\n this.enhanceController();\n this.observe();\n }\n processNodeDOMMutation(node, initialChangeModeAssumption) {\n let nodule = node;\n let change = initialChangeModeAssumption;\n let supportedTargets = [];\n if (nodule.nodeName == '#text' || this.targetsUsedByThisControllerFromNode(nodule).length == 0) {\n change = this.targetChanged;\n nodule = this.findTargetInAncestry(node);\n }\n else {\n supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n }\n if (nodule == null) {\n return;\n }\n else if (supportedTargets.length == 0) {\n supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n }\n supportedTargets.forEach((target) => {\n change.call(this, this.stripIdentifierPrefix(target), nodule, 'domMutation');\n });\n }\n findTargetInAncestry(node) {\n let nodule = node;\n let supportedTargets = [];\n if (nodule.nodeName != '#text') {\n supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n }\n while (nodule.parentNode !== null && nodule.parentNode != this.targetElement && supportedTargets.length == 0) {\n nodule = nodule.parentNode;\n if (nodule.nodeName !== '#text') {\n let supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n if (supportedTargets.length > 0) {\n return nodule;\n }\n }\n }\n if (nodule.nodeName == '#text') {\n return null;\n }\n if (nodule.parentNode == null) {\n return null;\n }\n if (nodule.parentNode == this.targetElement) {\n if (this.targetsUsedByThisControllerFromNode(nodule).length > 0) {\n return nodule;\n }\n return null;\n }\n return null;\n }\n targetAdded(name, node, trigger) {\n let targetCallback = `${name}TargetAdded`;\n this.controller[targetCallback] && method(this.controller, targetCallback).call(this.controller, node);\n this.log('targetAdded', { target: name, node, trigger });\n }\n targetRemoved(name, node, trigger) {\n let targetCallback = `${name}TargetRemoved`;\n this.controller[targetCallback] && method(this.controller, targetCallback).call(this.controller, node);\n this.log('targetRemoved', { target: name, node, trigger });\n }\n targetChanged(name, node, trigger) {\n let targetCallback = `${name}TargetChanged`;\n this.controller[targetCallback] && method(this.controller, targetCallback).call(this.controller, node);\n this.log('targetChanged', { target: name, node, trigger });\n }\n targetsUsedByThisControllerFromNode(node) {\n if (node.nodeName == '#text' || node.nodeName == '#comment') {\n return [];\n }\n let nodeElement = node;\n return this.targetsUsedByThisController(nodeElement.getAttribute(this.scopedTargetSelector) || nodeElement.getAttribute(this.targetSelector));\n }\n targetsUsedByThisController(targetStr) {\n targetStr = targetStr || '';\n let targetsToCheck = this.stripIdentifierPrefix(targetStr).split(' ');\n return this.targets.filter(n => targetsToCheck.indexOf(n) !== -1);\n }\n stripIdentifierPrefix(target) {\n return target.replace(new RegExp(this.identifierPrefix, 'g'), '');\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, { disconnect });\n }\n}\nconst useTargetMutation = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseTargetMutation(controller, options);\n return [observer.observe, observer.unobserve];\n};\n\nclass TargetMutationComposableController extends Controller {\n}\nclass TargetMutationController extends TargetMutationComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useTargetMutation(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nconst useWindowResize = (composableController) => {\n const controller = composableController;\n const callback = (event) => {\n const { innerWidth, innerHeight } = window;\n const payload = {\n height: innerHeight || Infinity,\n width: innerWidth || Infinity,\n event\n };\n method(controller, 'windowResize').call(controller, payload);\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observe = () => {\n window.addEventListener('resize', callback);\n callback();\n };\n const unobserve = () => {\n window.removeEventListener('resize', callback);\n };\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [observe, unobserve];\n};\n\nclass WindowResizeComposableController extends Controller {\n}\nclass WindowResizeController extends WindowResizeComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useWindowResize(this);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nconst memoize = (controller, name, value) => {\n Object.defineProperty(controller, name, { value });\n return value;\n};\nconst useMemo = (controller) => {\n var _a;\n (_a = controller.constructor.memos) === null || _a === void 0 ? void 0 : _a.forEach((getter) => {\n memoize(controller, getter, controller[getter]);\n });\n};\n\nclass DebounceController extends Controller {\n}\nDebounceController.debounces = [];\nconst defaultWait$1 = 200;\nconst debounce = (fn, wait = defaultWait$1) => {\n let timeoutId = null;\n return function () {\n const args = Array.from(arguments);\n const context = this;\n const params = args.map(arg => arg.params);\n const callback = () => {\n args.forEach((arg, index) => (arg.params = params[index]));\n return fn.apply(context, args);\n };\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(callback, wait);\n };\n};\nconst useDebounce = (composableController, options) => {\n const controller = composableController;\n const constructor = controller.constructor;\n constructor.debounces.forEach((func) => {\n if (typeof func === 'string') {\n controller[func] = debounce(controller[func], options === null || options === void 0 ? void 0 : options.wait);\n }\n if (typeof func === 'object') {\n const { name, wait } = func;\n if (!name)\n return;\n controller[name] = debounce(controller[name], wait || (options === null || options === void 0 ? void 0 : options.wait));\n }\n });\n};\n\nclass ThrottleController extends Controller {\n}\nThrottleController.throttles = [];\nconst defaultWait = 200;\nfunction throttle(func, wait = defaultWait) {\n let inThrottle;\n return function () {\n const args = arguments;\n const context = this;\n if (!inThrottle) {\n inThrottle = true;\n func.apply(context, args);\n setTimeout(() => (inThrottle = false), wait);\n }\n };\n}\nconst useThrottle = (composableController, options = {}) => {\n var _a;\n const controller = composableController;\n const constructor = controller.constructor;\n (_a = constructor.throttles) === null || _a === void 0 ? void 0 : _a.forEach((func) => {\n if (typeof func === 'string') {\n controller[func] = throttle(controller[func], options === null || options === void 0 ? void 0 : options.wait);\n }\n if (typeof func === 'object') {\n const { name, wait } = func;\n if (!name)\n return;\n controller[name] = throttle(controller[name], wait || (options === null || options === void 0 ? void 0 : options.wait));\n }\n });\n};\n\nconst defineMetaGetter = (controller, metaName, suffix) => {\n const getterName = suffix ? `${camelize(metaName)}Meta` : camelize(metaName);\n Object.defineProperty(controller, getterName, {\n get() {\n return typeCast(metaValue(metaName));\n }\n });\n};\nfunction metaValue(name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`);\n return element && element.getAttribute('content');\n}\nfunction typeCast(value) {\n try {\n return JSON.parse(value);\n }\n catch (o_O) {\n return value;\n }\n}\nconst useMeta = (controller, options = { suffix: true }) => {\n const metaNames = controller.constructor.metaNames;\n const suffix = options.suffix;\n metaNames === null || metaNames === void 0 ? void 0 : metaNames.forEach((metaName) => {\n defineMetaGetter(controller, metaName, suffix);\n });\n Object.defineProperty(controller, 'metas', {\n get() {\n const result = {};\n metaNames === null || metaNames === void 0 ? void 0 : metaNames.forEach((metaName) => {\n const value = typeCast(metaValue(metaName));\n if (value !== undefined && value !== null) {\n result[camelize(metaName)] = value;\n }\n });\n return result;\n }\n });\n};\n\nconst alpineNames = {\n enterFromClass: 'enter',\n enterActiveClass: 'enterStart',\n enterToClass: 'enterEnd',\n leaveFromClass: 'leave',\n leaveActiveClass: 'leaveStart',\n leaveToClass: 'leaveEnd'\n};\nconst defaultOptions$1 = {\n transitioned: false,\n hiddenClass: 'hidden',\n preserveOriginalClass: true,\n removeToClasses: true\n};\nconst useTransition = (composableController, options = {}) => {\n var _a, _b, _c;\n const controller = composableController;\n const targetName = controller.element.dataset.transitionTarget;\n let targetFromAttribute;\n if (targetName) {\n targetFromAttribute = controller[`${targetName}Target`];\n }\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || targetFromAttribute || controller.element;\n if (!(targetElement instanceof HTMLElement || targetElement instanceof SVGElement))\n return;\n const dataset = targetElement.dataset;\n const leaveAfter = parseInt(dataset.leaveAfter || '') || options.leaveAfter || 0;\n const { transitioned, hiddenClass, preserveOriginalClass, removeToClasses } = Object.assign({}, defaultOptions$1, options);\n const controllerEnter = (_a = controller.enter) === null || _a === void 0 ? void 0 : _a.bind(controller);\n const controllerLeave = (_b = controller.leave) === null || _b === void 0 ? void 0 : _b.bind(controller);\n const controllerToggleTransition = (_c = controller.toggleTransition) === null || _c === void 0 ? void 0 : _c.bind(controller);\n async function enter(event) {\n if (controller.transitioned)\n return;\n controller.transitioned = true;\n controllerEnter && controllerEnter(event);\n const enterFromClasses = getAttribute('enterFrom', options, dataset);\n const enterActiveClasses = getAttribute('enterActive', options, dataset);\n const enterToClasses = getAttribute('enterTo', options, dataset);\n const leaveToClasses = getAttribute('leaveTo', options, dataset);\n if (!!hiddenClass) {\n targetElement.classList.remove(hiddenClass);\n }\n if (!removeToClasses) {\n removeClasses(targetElement, leaveToClasses);\n }\n await transition(targetElement, enterFromClasses, enterActiveClasses, enterToClasses, hiddenClass, preserveOriginalClass, removeToClasses);\n if (leaveAfter > 0) {\n setTimeout(() => {\n leave(event);\n }, leaveAfter);\n }\n }\n async function leave(event) {\n if (!controller.transitioned)\n return;\n controller.transitioned = false;\n controllerLeave && controllerLeave(event);\n const leaveFromClasses = getAttribute('leaveFrom', options, dataset);\n const leaveActiveClasses = getAttribute('leaveActive', options, dataset);\n const leaveToClasses = getAttribute('leaveTo', options, dataset);\n const enterToClasses = getAttribute('enterTo', options, dataset);\n if (!removeToClasses) {\n removeClasses(targetElement, enterToClasses);\n }\n await transition(targetElement, leaveFromClasses, leaveActiveClasses, leaveToClasses, hiddenClass, preserveOriginalClass, removeToClasses);\n if (!!hiddenClass) {\n targetElement.classList.add(hiddenClass);\n }\n }\n function toggleTransition(event) {\n controllerToggleTransition && controllerToggleTransition(event);\n if (controller.transitioned) {\n leave();\n }\n else {\n enter();\n }\n }\n async function transition(element, initialClasses, activeClasses, endClasses, hiddenClass, preserveOriginalClass, removeEndClasses) {\n const stashedClasses = [];\n if (preserveOriginalClass) {\n initialClasses.forEach(cls => element.classList.contains(cls) && cls !== hiddenClass && stashedClasses.push(cls));\n activeClasses.forEach(cls => element.classList.contains(cls) && cls !== hiddenClass && stashedClasses.push(cls));\n endClasses.forEach(cls => element.classList.contains(cls) && cls !== hiddenClass && stashedClasses.push(cls));\n }\n addClasses(element, initialClasses);\n removeClasses(element, stashedClasses);\n addClasses(element, activeClasses);\n await nextAnimationFrame();\n removeClasses(element, initialClasses);\n addClasses(element, endClasses);\n await afterTransition(element);\n removeClasses(element, activeClasses);\n if (removeEndClasses) {\n removeClasses(element, endClasses);\n }\n addClasses(element, stashedClasses);\n }\n function initialState() {\n controller.transitioned = transitioned;\n if (transitioned) {\n if (!!hiddenClass) {\n targetElement.classList.remove(hiddenClass);\n }\n enter();\n }\n else {\n if (!!hiddenClass) {\n targetElement.classList.add(hiddenClass);\n }\n leave();\n }\n }\n function addClasses(element, classes) {\n if (classes.length > 0) {\n element.classList.add(...classes);\n }\n }\n function removeClasses(element, classes) {\n if (classes.length > 0) {\n element.classList.remove(...classes);\n }\n }\n initialState();\n Object.assign(controller, { enter, leave, toggleTransition });\n return [enter, leave, toggleTransition];\n};\nfunction getAttribute(name, options, dataset) {\n const datasetName = `transition${name[0].toUpperCase()}${name.substr(1)}`;\n const datasetAlpineName = alpineNames[name];\n const classes = options[name] || dataset[datasetName] || dataset[datasetAlpineName] || ' ';\n return isEmpty(classes) ? [] : classes.split(' ');\n}\nasync function afterTransition(element) {\n return new Promise(resolve => {\n const duration = Number(getComputedStyle(element).transitionDuration.split(',')[0].replace('s', '')) * 1000;\n setTimeout(() => {\n resolve(duration);\n }, duration);\n });\n}\nasync function nextAnimationFrame() {\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n requestAnimationFrame(resolve);\n });\n });\n}\nfunction isEmpty(str) {\n return str.length === 0 || !str.trim();\n}\n\nclass TransitionComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.transitioned = false;\n }\n}\nclass TransitionController extends TransitionComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n useTransition(this, this.options);\n });\n }\n}\n\nclass UseHotkeys extends StimulusUse {\n constructor(controller, hotkeysOptions) {\n super(controller, hotkeysOptions);\n this.bind = () => {\n for (const [hotkey, definition] of Object.entries(this.hotkeysOptions.hotkeys)) {\n const handler = definition.handler.bind(this.controller);\n hotkeys(hotkey, definition.options, (e) => handler(e, e));\n }\n };\n this.unbind = () => {\n for (const hotkey in this.hotkeysOptions.hotkeys) {\n hotkeys.unbind(hotkey);\n }\n };\n this.controller = controller;\n this.hotkeysOptions = hotkeysOptions;\n this.enhanceController();\n this.bind();\n }\n enhanceController() {\n if (this.hotkeysOptions.filter) {\n hotkeys.filter = this.hotkeysOptions.filter;\n }\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unbind();\n controllerDisconnect();\n };\n Object.assign(this.controller, { disconnect });\n }\n}\nconst convertSimpleHotkeyDefinition = (definition) => {\n return {\n handler: definition[0],\n options: {\n element: definition[1]\n }\n };\n};\nconst coerceOptions = (options) => {\n if (!options.hotkeys) {\n const hotkeys = {};\n Object.entries(options).forEach(([hotkey, definition]) => {\n Object.defineProperty(hotkeys, hotkey, {\n value: convertSimpleHotkeyDefinition(definition),\n writable: false,\n enumerable: true\n });\n });\n options = {\n hotkeys\n };\n }\n return options;\n};\nconst useHotkeys = (controller, options) => {\n return new UseHotkeys(controller, coerceOptions(options));\n};\n\nconst defaultOptions = {\n mediaQueries: {},\n dispatchEvent: true,\n eventPrefix: true,\n debug: false\n};\nclass UseMatchMedia extends StimulusUse {\n constructor(controller, options = {}) {\n var _a, _b, _c, _d;\n super(controller, options);\n this.matches = [];\n this.callback = (event) => {\n const name = Object.keys(this.mediaQueries).find(name => this.mediaQueries[name] === event.media);\n if (!name)\n return;\n const { media, matches } = event;\n this.changed({ name, media, matches, event });\n };\n this.changed = (payload) => {\n const { name } = payload;\n if (payload.event) {\n this.call(camelize(`${name}_changed`), payload);\n this.dispatch(`${name}:changed`, payload);\n this.log(`media query \"${name}\" changed`, payload);\n }\n if (payload.matches) {\n this.call(camelize(`is_${name}`), payload);\n this.dispatch(`is:${name}`, payload);\n }\n else {\n this.call(camelize(`not_${name}`), payload);\n this.dispatch(`not:${name}`, payload);\n }\n };\n this.observe = () => {\n Object.keys(this.mediaQueries).forEach(name => {\n const media = this.mediaQueries[name];\n const match = window.matchMedia(media);\n match.addListener(this.callback);\n this.matches.push(match);\n this.changed({ name, media, matches: match.matches });\n });\n };\n this.unobserve = () => {\n this.matches.forEach(match => match.removeListener(this.callback));\n };\n this.controller = controller;\n this.mediaQueries = (_a = options.mediaQueries) !== null && _a !== void 0 ? _a : defaultOptions.mediaQueries;\n this.dispatchEvent = (_b = options.dispatchEvent) !== null && _b !== void 0 ? _b : defaultOptions.dispatchEvent;\n this.eventPrefix = (_c = options.eventPrefix) !== null && _c !== void 0 ? _c : defaultOptions.eventPrefix;\n this.debug = (_d = options.debug) !== null && _d !== void 0 ? _d : defaultOptions.debug;\n if (!window.matchMedia) {\n console.error('window.matchMedia() is not available');\n return;\n }\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, { disconnect });\n }\n}\nconst useMatchMedia = (controller, options = {}) => {\n const observer = new UseMatchMedia(controller, options);\n return [observer.observe, observer.unobserve];\n};\n\nclass UseWindowFocus extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n if (document.hasFocus()) {\n this.becomesFocused();\n }\n else {\n this.becomesUnfocused();\n }\n this.interval = setInterval(() => {\n this.handleWindowFocusChange();\n }, this.intervalDuration);\n };\n this.unobserve = () => {\n clearInterval(this.interval);\n };\n this.becomesUnfocused = (event) => {\n this.controller.hasFocus = false;\n this.call('unfocus', event);\n this.log('unfocus', { hasFocus: false });\n this.dispatch('unfocus', { event, hasFocus: false });\n };\n this.becomesFocused = (event) => {\n this.controller.hasFocus = true;\n this.call('focus', event);\n this.log('focus', { hasFocus: true });\n this.dispatch('focus', { event, hasFocus: true });\n };\n this.handleWindowFocusChange = (event) => {\n if (document.hasFocus() && !this.controller.hasFocus) {\n this.becomesFocused(event);\n }\n else if (!document.hasFocus() && this.controller.hasFocus) {\n this.becomesUnfocused(event);\n }\n };\n this.controller = controller;\n this.intervalDuration = options.interval || 200;\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controllerDisconnect;\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, { disconnect });\n }\n}\nconst useWindowFocus = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseWindowFocus(controller, options);\n return [observer.observe, observer.unobserve];\n};\n\nclass WindowFocusComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.hasFocus = false;\n }\n}\nclass WindowFocusController extends WindowFocusComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame(() => {\n const [observe, unobserve] = useWindowFocus(this, this.options);\n Object.assign(this, { observe, unobserve });\n });\n }\n}\n\nexport { ApplicationController, ClickOutsideController, HoverController, IdleController, IntersectionController, LazyLoadController, MutationController, ResizeController, TargetMutationController, TransitionController, UseHover, UseMutation, UseTargetMutation, UseVisibility, VisibilityController, WindowFocusController, WindowResizeController, useApplication, useClickOutside, useDebounce, useDispatch, useHotkeys, useHover, useIdle, useIntersection, useLazyLoad, useMatchMedia, useMemo, useMeta, useMutation, useResize, useTargetMutation, useThrottle, useTransition, useVisibility, useWindowFocus, useWindowResize };\n", "import { Controller as e } from \"@hotwired/stimulus\";\nimport { useTransition as t } from \"stimulus-use\";\nclass i extends e {\n initialize() {\n this.hide = this.hide.bind(this);\n }\n connect() {\n t(this), this.hiddenValue === !1 && this.show();\n }\n show() {\n this.enter(), this.timeout = setTimeout(this.hide, this.delayValue);\n }\n async hide() {\n this.timeout && clearTimeout(this.timeout), await this.leave(), this.element.remove();\n }\n}\ni.values = {\n delay: {\n type: Number,\n default: 3e3\n },\n hidden: {\n type: Boolean,\n default: !1\n }\n};\nexport {\n i as default\n};\n", "import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['checkbox']\n\n connect() {\n this.checkboxTargets.forEach(checkbox => {\n checkbox.addEventListener('change', this.updatePermissions.bind(this))\n })\n }\n\n updatePermissions(event) {\n const { checked, value } = event.target\n\n if (/members:/.test(value)) {\n if (value !== 'members:read' && checked) {\n this.checkReadCheckbox('members:read')\n }\n if (value === 'members:read' && !checked) {\n this.checkboxTargets.forEach(checkbox => {\n if (checkbox.value !== 'members:read') checkbox.checked = false\n })\n }\n } else {\n const namespace = value.split(':')[0]\n const readValue = `${namespace}:read`\n if (value !== readValue && checked) this.checkReadCheckbox(readValue)\n if (value === readValue && !checked) {\n this.checkboxTargets.forEach(checkbox => {\n if (checkbox.value !== readValue) checkbox.checked = false\n })\n }\n }\n }\n\n checkReadCheckbox(value) {\n const checkbox = this.checkboxTargets.find(\n checkbox => checkbox.value === value\n )\n if (!checkbox) return\n\n checkbox.checked = true\n // TODO: come up with a solution that works here, like disabling and enabling the checkbox on submit\n // checkbox.readonly = true\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { Turbo } from '@hotwired/turbo-rails'\n\nexport default class extends Controller {\n static targets = ['input']\n\n submit(event) {\n event.preventDefault()\n }\n\n search(event) {\n clearTimeout(this.timeout)\n this.timeout = setTimeout(() => {\n const value = event.target.value\n const url = new URL(window.location.href)\n url.searchParams.delete('page')\n\n if (value.length) {\n url.searchParams.set('q', value)\n } else {\n url.searchParams.delete('q')\n }\n\n Turbo.visit(url.href, {\n action: 'replace',\n })\n }, 300)\n }\n}\n", "/**!\n * Sortable 1.15.6\n * @author\tRubaXa <trash@rubaxa.org>\n * @author\towenm <owen23355@gmail.com>\n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.6\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nfunction getChildContainingRectFromElement(container, options, ghostEl) {\n var rect = {};\n Array.from(container.children).forEach(function (child) {\n var _rect$left, _rect$top, _rect$right, _rect$bottom;\n if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;\n var childRect = getRect(child);\n rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);\n rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);\n rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);\n rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);\n });\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n // Disabled on Safari: #1571; Enabled on Safari IOS: #2244\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n if (options.supportPointer) {\n on(ownerDocument, 'pointerup', _this._onDrop);\n // Native D&D triggers pointercancel\n !this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);\n } else {\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n }\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n if (options.supportPointer) {\n on(ownerDocument, 'pointerup', _this._disableDelayedDrag);\n on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);\n } else {\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n }\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'pointerup', this._disableDelayedDrag);\n off(ownerDocument, 'pointercancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = getParentOrHost(parent));\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n window.getSelection().removeAllRanges();\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'pointercancel', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild,\n expando: expando\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n (function () {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n var filter = options.filter;\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n // Check if element is draggable\n if (!closest(children[i], options.draggable, parentEl, false)) continue;\n // Check if element is filtered\n var filtered = filter && (typeof filter === 'function' ? filter.call(sortable, evt, children[i], sortable) : filter.split(',').some(function (criteria) {\n return closest(children[i], criteria.trim(), parentEl, false);\n }));\n if (filtered) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n })();\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n", "import { Controller } from '@hotwired/stimulus'\nimport Sortable from 'sortablejs'\nimport { post } from '@rails/request.js'\n\nexport default class extends Controller {\n static values = { url: String }\n\n connect() {\n this.sortable = Sortable.create(this.element, {\n animation: 150,\n forceFallback: true,\n handle: '.drag-handle',\n store: {\n set: sortable => {\n const keys = sortable.toArray()\n\n post(this.urlValue, {\n body: { keys },\n })\n },\n },\n })\n }\n\n disconnect() {\n this.sortable.destroy()\n }\n}\n", "// import { Controller } from 'stimulus'\nimport { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static values = { initial: Boolean, destroy: Boolean }\n hasDestroyValue: boolean\n hasInitialValue: boolean\n observer: MutationObserver\n currentDisplayStyle: string\n\n initialize(): void {\n this.observer = new MutationObserver(mutations => {\n this.observer.disconnect()\n this.verifyChange.call(this, mutations)\n })\n if (this.hasInitialValue) this.enter()\n else this.startObserver()\n }\n\n async enter(): Promise<void> {\n await this.runTransition('enter')\n this.dispatchEnd('enter')\n this.startObserver()\n }\n\n async leave(attribute?: string | null): Promise<void> {\n // Cancel out the display style\n if (attribute === 'hidden') (this.element as HTMLElement).hidden = false\n else this.displayStyle = this.currentDisplayStyle\n\n await this.runTransition('leave')\n\n // Restore the display style to previous value\n if (attribute === 'hidden') (this.element as HTMLElement).hidden = true\n else this.displayStyle = attribute === 'style' ? 'none' : undefined\n\n this.dispatchEnd('leave')\n\n // Destroy element, or restart observer\n if (this.hasDestroyValue) this.element.remove()\n else this.startObserver()\n }\n\n // Helpers for transition\n private nextFrame(): Promise<number> {\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n requestAnimationFrame(resolve)\n })\n })\n }\n\n private afterTransition(): Promise<void> {\n return new Promise(resolve => {\n const duration =\n Number(\n getComputedStyle(this.element)\n .transitionDuration.split(',')[0]\n .replace('s', '')\n ) * 1000\n\n setTimeout(() => {\n resolve()\n }, duration)\n })\n }\n\n private async runTransition(dir: 'enter' | 'leave'): Promise<void> {\n const activeClasses = this.getTransitionClasses(`${dir}-active`)\n const fromClasses = this.getTransitionClasses(`${dir}-from`)\n const toClasses = this.getTransitionClasses(`${dir}-to`)\n\n this.element.classList.add(...activeClasses)\n this.element.classList.add(...fromClasses)\n\n await this.nextFrame()\n\n this.element.classList.remove(...fromClasses)\n this.element.classList.add(...toClasses)\n\n await this.afterTransition()\n\n this.element.classList.remove(...toClasses)\n this.element.classList.remove(...activeClasses)\n }\n\n private getTransitionClasses(name: string): string[] {\n return (\n this.element.getAttribute(`data-transition-${name}`)?.split(' ') ?? []\n )\n }\n\n private dispatchEnd(dir: 'enter' | 'leave') {\n const type = `transition:end-${dir}`\n const event = new CustomEvent(type, { bubbles: true, cancelable: true })\n this.element.dispatchEvent(event)\n return event\n }\n\n private get display(): string {\n return getComputedStyle(this.element)['display']\n }\n\n private set displayStyle(v: string | undefined) {\n v\n ? (this.element as HTMLElement).style.setProperty('display', v)\n : (this.element as HTMLElement).style.removeProperty('display')\n }\n\n // Helpers for observer\n private verifyChange(mutations: MutationRecord[]): void {\n const newDisplayStyle = this.display\n // console.log('verifying change')\n\n // Make sure there is a new computed displayStyle && the it was or will be \"none\"\n if (\n newDisplayStyle !== this.currentDisplayStyle &&\n (newDisplayStyle === 'none' || this.currentDisplayStyle === 'none')\n )\n newDisplayStyle === 'none'\n ? this.leave(mutations[0].attributeName)\n : this.enter()\n else this.startObserver()\n }\n\n private startObserver(): void {\n // console.log('start observer')\n this.currentDisplayStyle = this.display\n if (this.element.isConnected)\n this.observer.observe(this.element, {\n attributeFilter: ['class', 'hidden', 'style'],\n })\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { get, post } from '@rails/request.js'\n\nexport default class extends Controller {\n getTurboStream(event) {\n event.preventDefault()\n get(event.target.href, {\n contentType: 'text/vnd.turbo-stream.html',\n responseKind: 'turbo-stream',\n })\n }\n\n postTurboStream(event) {\n event.preventDefault()\n post(event.target.href, {\n contentType: 'text/vnd.turbo-stream.html',\n responseKind: 'turbo-stream',\n })\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\n// Connects to data-controller=\"turbo-modal\"\nexport default class extends Controller {\n static targets = ['container', 'content', 'background']\n static values = {\n backdropColor: { type: String, default: 'rgba(0, 0, 0, 0.8)' },\n restoreScroll: { type: Boolean, default: true },\n }\n\n connect() {\n // The class we should toggle on the container\n this.toggleClass = this.data.get('class') || 'hidden'\n\n // The ID of the background to hide/remove\n this.backgroundId = this.data.get('backgroundId') || 'modal-background'\n\n // The HTML for the background element\n this.backgroundHtml =\n this.data.get('backgroundHtml') || this._backgroundHTML()\n\n // Let the user close the modal by clicking on the background\n this.allowBackgroundClose =\n (this.data.get('allowBackgroundClose') || 'true') === 'true'\n\n // Prevent the default action of the clicked element (following a link for example) when opening the modal\n this.preventDefaultActionOpening =\n (this.data.get('preventDefaultActionOpening') || 'true') === 'true'\n\n // Prevent the default action of the clicked element (following a link for example) when closing the modal\n this.preventDefaultActionClosing =\n (this.data.get('preventDefaultActionClosing') || 'true') === 'true'\n\n this.setupListener()\n this.open()\n }\n\n disconnect() {\n this.removeListener()\n this.close()\n }\n\n open() {\n // Lock the scroll and save current scroll position\n this.lockScroll()\n\n // // Unhide the modal\n this.containerTarget.classList.remove(this.toggleClass)\n this.contentTarget.classList.remove(this.toggleClass)\n this.backgroundTarget.classList.remove(this.toggleClass)\n\n // Insert the background\n if (!this.data.get('disable-backdrop')) {\n // document.body.insertAdjacentHTML('beforeend', this.backgroundHtml)\n this.background = document.querySelector(`#${this.backgroundId}`)\n }\n }\n\n close(e) {\n if (e && this.preventDefaultActionClosing) {\n e.preventDefault()\n }\n\n // Unlock the scroll and restore previous scroll position\n this.unlockScroll()\n\n // Hide the modal\n this.containerTarget.classList.add(this.toggleClass)\n this.contentTarget.classList.add(this.toggleClass)\n\n // Remove the background\n if (this.background) {\n // this.background.remove()\n this.background.classList.add(this.toggleClass)\n }\n\n setTimeout(() => {\n if (!this.element.parentElement) return\n this.element.parentElement.removeAttribute('src')\n this.element.remove()\n }, 300)\n }\n\n closeBackground(e) {\n if (this.allowBackgroundClose && e.target === this.containerTarget) {\n this.close(e)\n }\n }\n\n closeWithKeyboard(event) {\n if (\n event.keyCode === 27 &&\n !this.containerTarget.classList.contains(this.toggleClass) &&\n !['input', 'textarea'].includes(event.target.tagName.toLowerCase())\n ) {\n this.close(event)\n }\n }\n\n _backgroundHTML() {\n return `<div\n id=\"${this.backgroundId}\"\n class=\"z-20 transform transition-all anim-fade-in fixed inset-0 bg-neutral-500 dark:bg-neutral-900 bg-opacity-50 dark:bg-opacity-75 anim-fade-in\"\n ></div>`\n }\n\n lockScroll() {\n // Add right padding to the body so the page doesn't shift\n // when we disable scrolling\n const scrollbarWidth =\n window.innerWidth - document.documentElement.clientWidth\n document.body.style.paddingRight = `${scrollbarWidth}px`\n\n // Save the scroll position\n this.saveScrollPosition()\n\n // Add classes to body to fix its position\n document.body.classList.add('fixed', 'inset-x-0', 'overflow-hidden')\n\n // Add negative top position in order for body to stay in place\n document.body.style.top = `-${this.scrollPosition}px`\n }\n\n unlockScroll() {\n // Remove tweaks for scrollbar\n document.body.style.paddingRight = null\n\n // Remove classes from body to unfix position\n document.body.classList.remove('fixed', 'inset-x-0', 'overflow-hidden')\n\n // Restore the scroll position of the body before it got locked\n if (this.restoreScrollValue) {\n this.restoreScrollPosition()\n }\n\n // Remove the negative top inline style from body\n document.body.style.top = null\n }\n\n saveScrollPosition() {\n this.scrollPosition = window.pageYOffset || document.body.scrollTop\n }\n\n restoreScrollPosition() {\n if (this.scrollPosition === undefined) return\n\n document.documentElement.scrollTop = this.scrollPosition\n }\n\n onSubmitEnd = event => {\n if (event.detail.success && this.data.get('closeOnSuccess') === 'true') {\n this.close()\n }\n }\n\n setupListener() {\n this.element.addEventListener('turbo:submit-end', this.onSubmitEnd)\n }\n\n removeListener() {\n this.element.removeEventListener('turbo:submit-end', this.onSubmitEnd)\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport class CancellationFormController extends Controller {\n static targets = ['input', 'datepicker']\n static values = {\n action: String,\n }\n\n declare readonly datepickerTarget: HTMLInputElement\n declare readonly inputTargets: HTMLInputElement[]\n declare actionValue: string\n\n connect() {\n this.inputTargets[0].click()\n }\n\n actionValueChanged() {\n if (this.actionValue === 'scheduled') {\n this.datepickerTarget.classList.remove('hidden')\n this.datepickerTarget.disabled = false\n } else {\n this.datepickerTarget.classList.add('hidden')\n this.datepickerTarget.disabled = true\n }\n }\n\n toggle(event: any) {\n this.actionValue = event.target.value\n\n this.inputTargets.forEach(target => {\n let label = target.parentElement\n if (!label) return\n\n if (target.value === 'scheduled') label = label.parentElement\n if (!label) return\n\n const title = label.querySelector(\n '[data-id=\"cancellation-form-option-title\"]'\n )\n const description = label.querySelector(\n '[data-id=\"cancellation-form-option-description\"]'\n )\n\n if (target.value === event.target.value) {\n label.classList.add(\n 'z-10',\n 'border-primary-200',\n 'dark:border-neutral-600',\n 'bg-primary-50',\n 'dark:bg-neutral-900/50'\n )\n label.classList.remove('border-gray-200', 'dark:border-neutral-700')\n\n if (title) {\n title.classList.add('text-primary-900', 'dark:text-neutral-100')\n title.classList.remove('text-gray-900', 'dark:text-neutral-300')\n }\n\n if (description) {\n description.classList.add('text-primary-700', 'dark:text-neutral-300')\n description.classList.remove('text-gray-500', 'dark:text-neutral-500')\n }\n } else {\n label.classList.add('border-gray-200', 'dark:border-neutral-700')\n label.classList.remove(\n 'z-10',\n 'border-primary-200',\n 'dark:border-neutral-600',\n 'bg-primary-50',\n 'dark:bg-neutral-900/50'\n )\n\n if (title) {\n title.classList.remove('text-primary-900', 'dark:text-neutral-100')\n title.classList.add('text-gray-900', 'dark:text-neutral-300')\n }\n\n if (description) {\n description.classList.remove(\n 'text-primary-700',\n 'dark:text-neutral-300'\n )\n description.classList.add('text-gray-500', 'dark:text-neutral-500')\n }\n }\n })\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport class CurrentConversationController extends Controller {\n connect(): void {\n this.setupListener()\n this.setActiveConversation()\n }\n\n disconnect(): void {\n this.removeListener()\n }\n\n private setupListener() {\n this.element.addEventListener(\n 'turbo:frame-load',\n this.setActiveConversation\n )\n }\n\n private removeListener() {\n this.element.removeEventListener(\n 'turbo:frame-load',\n this.setActiveConversation\n )\n }\n\n private setActiveConversation() {\n const parts = window.location.pathname.split('/')\n const conversationId = parts[parts.length - 1]\n const elementId = `conversation_${conversationId}`\n\n document.querySelectorAll('.conversation-link').forEach(element => {\n if (element.parentElement?.id === elementId) {\n element.classList.add('bg-primary-600/10', 'dark:bg-neutral-700')\n element.classList.remove(\n 'text-gray-900',\n 'dark:text-neutral-500',\n 'hover:bg-gray-50',\n 'hover:dark:bg-neutral-800'\n )\n } else {\n element.classList.remove('bg-primary-600/10', 'dark:bg-neutral-700')\n element.classList.add(\n 'text-gray-900',\n 'dark:text-neutral-500',\n 'hover:bg-gray-50',\n 'hover:dark:bg-neutral-800'\n )\n }\n })\n }\n}\n", "// Visit The Stimulus Handbook for more details\n// https://stimulusjs.org/handbook/introduction\n\n// This example controller works with specially annotated HTML like:\n\n// <div class=\"relative\"\n// data-controller=\"dropdown\"\n// data-action=\"click->dropdown#toggle click@window->dropdown#hide\"\n// data-dropdown-active-target=\"#dropdown-button\"\n// data-dropdown-active-class=\"bg-teal-600\"\n// data-dropdown-invisible-class=\"opacity-0 scale-95\"\n// data-dropdown-visible-class=\"opacity-100 scale-100\"\n// data-dropdown-entering-class=\"ease-out duration-100\"\n// data-dropdown-enter-timeout=\"100\"\n// data-dropdown-leaving-class=\"ease-in duration-75\"\n// data-dropdown-leave-timeout=\"75\">\n// <div data-action=\"click->dropdown#toggle click@window->dropdown#hide\" role=\"button\" data-dropdown-target=\"button\" tabindex=\"0\" class=\"inline-block select-none\">\n// Open Dropdown\n// </div>\n// <div data-dropdown-target=\"menu\" class=\"absolute pin-r mt-2 transform transition hidden opacity-0 scale-95\">\n// <div class=\"bg-white shadow rounded border overflow-hidden\">\n// Content\n// </div>\n// </div>\n// </div>\n\nimport { Controller } from '@hotwired/stimulus'\n\nexport class DropdownController extends Controller {\n static targets = ['menu', 'button']\n static values = { open: Boolean }\n\n declare readonly buttonTarget: HTMLButtonElement\n declare readonly menuTarget: HTMLElement\n declare readonly hasButtonTarget: boolean\n declare readonly hasMenuTarget: boolean\n declare openValue: boolean\n\n private activeIndex: number = 0\n private capturedFocus: boolean = false\n private toggleClass: string = 'hidden'\n private visibleClass: string | null = null\n private invisibleClass: string | null = null\n private activeClass: string | null = null\n private enteringClass: string | null = null\n private leavingClass: string | null = null\n\n // initialize() {\n // this.keyboardListener = this.keyboardListener.bind(this)\n // this.activeIndex = 0\n // this.capturedFocus = false\n // }\n\n connect() {\n this.toggleClass = this.data.get('class') || 'hidden'\n this.visibleClass = this.data.get('visibleClass') || null\n this.invisibleClass = this.data.get('invisibleClass') || null\n this.activeClass = this.data.get('activeClass') || null\n this.enteringClass = this.data.get('enteringClass') || null\n this.leavingClass = this.data.get('leavingClass') || null\n\n if (this.hasButtonTarget) {\n this.buttonTarget.addEventListener('keydown', this._onMenuButtonKeydown)\n }\n\n this.element.setAttribute('aria-haspopup', 'true')\n document.addEventListener('keydown', this.keyboardListener)\n }\n\n disconnect() {\n if (this.hasButtonTarget) {\n this.buttonTarget.removeEventListener(\n 'keydown',\n this._onMenuButtonKeydown\n )\n }\n\n document?.removeEventListener('keydown', this.keyboardListener)\n this.activeIndex = 0\n this.capturedFocus = false\n }\n\n keyboardListener = (event: KeyboardEvent) => {\n if (!this.openValue) return\n if (this.keyboardFocusableElements.length === 0) return\n\n switch (event.key) {\n case 'Tab':\n if (!this.capturedFocus) {\n // used for first time, to capture focus, then we let the browser do it's thing\n this._focusFirstElement()\n event.preventDefault()\n }\n break\n case 'Escape':\n this.openValue = false\n break\n case 'ArrowUp':\n this._handleArrowUpKeyPress()\n event.preventDefault()\n break\n case 'ArrowDown':\n this._handleArrowDownKeyPress()\n event.preventDefault()\n }\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n openValueChanged() {\n if (this.openValue) {\n this._show()\n } else {\n this._hide()\n }\n }\n\n private _show = (callback?: () => void) => {\n setTimeout(\n (() => {\n this.menuTarget.classList.remove(this.toggleClass)\n this.element.setAttribute('aria-expanded', 'true')\n this._enteringClassList[0].forEach(\n (klass => {\n this.menuTarget.classList.add(klass)\n }).bind(this)\n )\n\n this._activeClassList[0].forEach(klass => {\n this.activeTarget?.classList.add(klass)\n })\n this._invisibleClassList[0].forEach(klass =>\n this.menuTarget.classList.remove(klass)\n )\n this._visibleClassList[0].forEach(klass => {\n this.menuTarget.classList.add(klass)\n })\n setTimeout(\n (() => {\n this._enteringClassList[0].forEach(klass =>\n this.menuTarget.classList.remove(klass)\n )\n }).bind(this),\n this.enterTimeout[0]\n )\n\n if (typeof callback == 'function') callback()\n }).bind(this)\n )\n }\n\n private _hide = (callback?: () => void) => {\n setTimeout(\n (() => {\n this.element.setAttribute('aria-expanded', 'false')\n this._invisibleClassList[0].forEach(klass =>\n this.menuTarget.classList.add(klass)\n )\n this._visibleClassList[0].forEach(klass =>\n this.menuTarget.classList.remove(klass)\n )\n this._activeClassList[0].forEach(klass =>\n this.activeTarget?.classList.remove(klass)\n )\n this._leavingClassList[0].forEach(klass =>\n this.menuTarget.classList.add(klass)\n )\n setTimeout(\n (() => {\n this._leavingClassList[0].forEach(klass =>\n this.menuTarget.classList.remove(klass)\n )\n if (typeof callback == 'function') callback()\n\n this.menuTarget.classList.add(this.toggleClass)\n }).bind(this),\n this.leaveTimeout[0]\n )\n }).bind(this)\n )\n }\n\n private _onMenuButtonKeydown = (event: KeyboardEvent) => {\n switch (event.keyCode) {\n case 13: // enter\n case 32: // space\n event.preventDefault()\n this.toggle()\n }\n }\n\n show() {\n this.openValue = true\n }\n\n hide(event) {\n if (this.element.contains(event.target) === false && this.openValue) {\n this.openValue = false\n }\n }\n\n private _focusFirstElement() {\n this.keyboardFocusableElements[0].focus()\n this.capturedFocus = true\n }\n\n private _focusLastElement() {\n const lastItemIndex = this.keyboardFocusableElements.length - 1\n this.keyboardFocusableElements[lastItemIndex].focus()\n\n this.activeIndex = lastItemIndex\n }\n\n private _handleArrowUpKeyPress() {\n if (this.activeIndex === 0) {\n this._focusLastElement()\n return\n }\n\n if (this.capturedFocus && this.activeIndex >= 1) {\n this.keyboardFocusableElements[this.activeIndex - 1].focus()\n this.activeIndex -= 1\n }\n }\n\n private _handleArrowDownKeyPress() {\n if (!this.capturedFocus) {\n this._focusFirstElement()\n } else if (this.activeIndex === this.keyboardFocusableElements.length - 1) {\n this.activeIndex = 0\n this._focusFirstElement()\n } else {\n this.keyboardFocusableElements[this.activeIndex + 1].focus()\n this.activeIndex += 1\n }\n }\n\n get activeTarget() {\n return this.data.has('activeTarget')\n ? document.querySelector(this.data.get('activeTarget'))\n : this.element\n }\n\n get _activeClassList() {\n return !this.activeClass\n ? [[], []]\n : this.activeClass.split(',').map(classList => classList.split(' '))\n }\n\n get _visibleClassList() {\n return !this.visibleClass\n ? [[], []]\n : this.visibleClass.split(',').map(classList => classList.split(' '))\n }\n\n get _invisibleClassList() {\n return !this.invisibleClass\n ? [[], []]\n : this.invisibleClass.split(',').map(classList => classList.split(' '))\n }\n\n get _enteringClassList() {\n return !this.enteringClass\n ? [[], []]\n : this.enteringClass.split(',').map(classList => classList.split(' '))\n }\n\n get _leavingClassList() {\n return !this.leavingClass\n ? [[], []]\n : this.leavingClass.split(',').map(classList => classList.split(' '))\n }\n\n get enterTimeout() {\n let timeout = this.data.get('enterTimeout') || '0,0'\n return timeout.split(',').map(t => parseInt(t))\n }\n\n get leaveTimeout() {\n let timeout = this.data.get('leaveTimeout') || '0,0'\n return timeout.split(',').map(t => parseInt(t))\n }\n\n get keyboardFocusableElements() {\n return [\n ...this.menuTarget.querySelectorAll(\n 'a[href], button, input, textarea, select, details,[tabindex]:not([tabindex=\"-1\"])'\n ),\n ].filter(\n el => !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden')\n )\n }\n}\n", "export function logProperty(prop) {\n switch (prop) {\n case \"application\":\n case \"el\":\n case \"element\":\n case \"constructor\":\n case \"initialize\":\n case \"log\":\n case \"logEvent\":\n case \"dispatch\":\n case \"data\":\n case \"valueDescriptorMap\":\n case \"mutate\":\n case \"identifier\":\n return false;\n }\n if (/^_.*?$/.test(prop)) {\n return false;\n }\n if (/^.*?Target(s)?$/.test(prop)) {\n return false;\n }\n if (/^.*?Value$/.test(prop)) {\n return false;\n }\n if (/^.*?ValueChanged$/.test(prop)) {\n return false;\n }\n if (/^.*?Class$/.test(prop)) {\n return false;\n }\n if (/^.*?Classes$/.test(prop)) {\n return false;\n }\n if (/^.*?ClassesPresent$/.test(prop)) {\n return false;\n }\n return true;\n}\nexport function log(controller, functionName, args = {}) {\n if (!controller.application.debug) {\n return;\n }\n const logger = console;\n logger.groupCollapsed(...colorize(controller.identifier, \"#3B82F6\"), `#${functionName}`);\n logger.log({\n element: controller.element,\n controller: controller,\n ...args,\n });\n logger.groupEnd();\n}\nexport function warn(controller, warning, args = {}) {\n if (!controller.application.debug) {\n return;\n }\n const logger = console;\n logger.groupCollapsed(...colorize(controller.identifier, \"#F39B1AFF\"), `!! ${warning} !!`);\n logger.warn({\n element: controller.element,\n controller: controller,\n ...args,\n });\n logger.groupEnd();\n}\nexport function logEvent(controller, eventName, event, element) {\n if (!controller.application.debug) {\n return;\n }\n const logger = console;\n logger.groupCollapsed(...colorizeMany([\n { text: controller.identifier, color: \"#3B82F6\" },\n { text: eventName, color: \"#0be000\" },\n ]), event.detail);\n logger.log(...colorize(\"Dispatched on\", \"#3b82f6\"), element);\n logger.log(...colorize(\"event\", \"#3b82f6\"), event);\n logger.log(...colorize(\"event details\", \"#3b82f6\"), event.detail);\n logger.groupEnd();\n}\nfunction colorize(text, color) {\n return colorizeMany([{ text, color }]);\n}\nfunction colorizeMany(texts) {\n let str = \"\";\n const colors = texts.flatMap((x) => {\n str += `%c${x.text}%c `;\n return [`color: ${x.color}`, \"color: unset\"];\n });\n return [str, ...colors];\n}\n", "import { logEvent } from \"./logging\";\nexport function dispatchEvent(controller, element, eventName, options = {}) {\n const mergedOptions = Object.assign({}, { bubbles: true, cancelable: true, detail: { target: element } }, options);\n if (!mergedOptions.detail.target) {\n mergedOptions.detail.target = element;\n }\n const event = new CustomEvent(eventName, mergedOptions);\n logEvent(controller, eventName, event, element);\n element.dispatchEvent(event);\n}\n", "import { Controller } from \"@hotwired/stimulus\";\nimport { log, logProperty } from \"./logging\";\nimport { dispatchEvent } from \"./events\";\nexport class BaseController extends Controller {\n constructor(context) {\n super(context);\n // @ts-ignore\n if (!this.application.debug) {\n return this;\n }\n return new Proxy(this, {\n get: (obj, prop) => {\n const returnVal = Reflect.get(obj, prop);\n const self = this;\n if (\"logFormattedMessage\" in this.application) {\n return returnVal;\n }\n if (logProperty(prop.toString())) {\n if (typeof returnVal == \"function\") {\n return new Proxy(returnVal, {\n apply(target, thisArg, argArray) {\n log(self, prop.toString(), {\n args: argArray,\n });\n return Reflect.apply(target, thisArg, argArray);\n },\n });\n }\n else {\n log(this, prop.toString());\n }\n }\n return returnVal;\n },\n });\n }\n get el() {\n return this.element;\n }\n get isTurboPreview() {\n return document.documentElement.hasAttribute(\"data-turbo-preview\") || document.documentElement.hasAttribute(\"data-turbolinks-preview\");\n }\n get isTurbolinksPreview() {\n return this.isTurboPreview;\n }\n get csrfToken() {\n return this.metaValue(\"csrf-token\");\n }\n metaValue(name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`);\n return element?.getAttribute(\"content\") || null;\n }\n eventName(eventName) {\n return `${this.identifier}:${eventName}`;\n }\n dispatchEvent(element, eventName, options = {}) {\n dispatchEvent(this, element, eventName, options);\n }\n}\n", "export function wrapArray(x) {\n return Array.isArray(x) ? x : [x];\n}\n", "export function debounce(func, wait, immediate = false) {\n let timeout;\n return function (...args) {\n const later = () => {\n timeout = null;\n if (!immediate) {\n func.apply(this, args);\n }\n };\n const callNow = immediate && !timeout;\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(this, args);\n }\n };\n}\n", "const pow = Math.pow;\nconst sqrt = Math.sqrt;\nconst sin = Math.sin;\nconst cos = Math.cos;\nconst PI = Math.PI;\nconst c1 = 1.70158;\nconst c2 = c1 * 1.525;\nconst c3 = c1 + 1;\nconst c4 = (2 * PI) / 3;\nconst c5 = (2 * PI) / 4.5;\n// interface EasingDictionary {\n// [easing: string]: EasingFunction;\n// }\nconst bounceOut = function (x) {\n const n1 = 7.5625;\n const d1 = 2.75;\n if (x < 1 / d1) {\n return n1 * x * x;\n }\n else if (x < 2 / d1) {\n return n1 * (x -= 1.5 / d1) * x + 0.75;\n }\n else if (x < 2.5 / d1) {\n return n1 * (x -= 2.25 / d1) * x + 0.9375;\n }\n else {\n return n1 * (x -= 2.625 / d1) * x + 0.984375;\n }\n};\nexport const EasingFunctions = {\n linear: (x) => x,\n easeInQuad: function (x) {\n return x * x;\n },\n easeOutQuad: function (x) {\n return 1 - (1 - x) * (1 - x);\n },\n easeInOutQuad: function (x) {\n return x < 0.5 ? 2 * x * x : 1 - pow(-2 * x + 2, 2) / 2;\n },\n easeInCubic: function (x) {\n return x * x * x;\n },\n easeOutCubic: function (x) {\n return 1 - pow(1 - x, 3);\n },\n easeInOutCubic: function (x) {\n return x < 0.5 ? 4 * x * x * x : 1 - pow(-2 * x + 2, 3) / 2;\n },\n easeInQuart: function (x) {\n return x * x * x * x;\n },\n easeOutQuart: function (x) {\n return 1 - pow(1 - x, 4);\n },\n easeInOutQuart: function (x) {\n return x < 0.5 ? 8 * x * x * x * x : 1 - pow(-2 * x + 2, 4) / 2;\n },\n easeInQuint: function (x) {\n return x * x * x * x * x;\n },\n easeOutQuint: function (x) {\n return 1 - pow(1 - x, 5);\n },\n easeInOutQuint: function (x) {\n return x < 0.5 ? 16 * x * x * x * x * x : 1 - pow(-2 * x + 2, 5) / 2;\n },\n easeInSine: function (x) {\n return 1 - cos((x * PI) / 2);\n },\n easeOutSine: function (x) {\n return sin((x * PI) / 2);\n },\n easeInOutSine: function (x) {\n return -(cos(PI * x) - 1) / 2;\n },\n easeInExpo: function (x) {\n return x === 0 ? 0 : pow(2, 10 * x - 10);\n },\n easeOutExpo: function (x) {\n return x === 1 ? 1 : 1 - pow(2, -10 * x);\n },\n easeInOutExpo: function (x) {\n return x === 0\n ? 0\n : x === 1\n ? 1\n : x < 0.5\n ? pow(2, 20 * x - 10) / 2\n : (2 - pow(2, -20 * x + 10)) / 2;\n },\n easeInCirc: function (x) {\n return 1 - sqrt(1 - pow(x, 2));\n },\n easeOutCirc: function (x) {\n return sqrt(1 - pow(x - 1, 2));\n },\n easeInOutCirc: function (x) {\n return x < 0.5\n ? (1 - sqrt(1 - pow(2 * x, 2))) / 2\n : (sqrt(1 - pow(-2 * x + 2, 2)) + 1) / 2;\n },\n easeInBack: function (x) {\n return c3 * x * x * x - c1 * x * x;\n },\n easeOutBack: function (x) {\n return 1 + c3 * pow(x - 1, 3) + c1 * pow(x - 1, 2);\n },\n easeInOutBack: function (x) {\n return x < 0.5\n ? (pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2)) / 2\n : (pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2;\n },\n easeInElastic: function (x) {\n return x === 0\n ? 0\n : x === 1\n ? 1\n : -pow(2, 10 * x - 10) * sin((x * 10 - 10.75) * c4);\n },\n easeOutElastic: function (x) {\n return x === 0\n ? 0\n : x === 1\n ? 1\n : pow(2, -10 * x) * sin((x * 10 - 0.75) * c4) + 1;\n },\n easeInOutElastic: function (x) {\n return x === 0\n ? 0\n : x === 1\n ? 1\n : x < 0.5\n ? -(pow(2, 20 * x - 10) * sin((20 * x - 11.125) * c5)) / 2\n : (pow(2, -20 * x + 10) * sin((20 * x - 11.125) * c5)) / 2 + 1;\n },\n easeInBounce: function (x) {\n return 1 - bounceOut(1 - x);\n },\n easeOutBounce: bounceOut,\n easeInOutBounce: function (x) {\n return x < 0.5\n ? (1 - bounceOut(1 - 2 * x)) / 2\n : (1 + bounceOut(2 * x - 1)) / 2;\n },\n};\n", "export function isHTMLLinkElement(element) {\n return element.nodeName == \"LINK\";\n}\nexport function isHTMLAnchorElement(element) {\n return element.nodeName == \"A\";\n}\nexport function isHTMLFormElement(element) {\n return element.nodeName == \"FORM\";\n}\nexport function isHTMLInputElement(element) {\n return element.nodeName == \"INPUT\";\n}\nexport function isHTMLLabelElement(element) {\n return element.nodeName == \"LABEL\";\n}\nexport function isHTMLTextAreaElement(element) {\n return element.nodeName == \"TEXTAREA\";\n}\nexport function isHTMLButtonElement(element) {\n return element.nodeName == \"BUTTON\";\n}\nexport function isHTMLSelectElement(element) {\n return element.nodeName == \"SELECT\";\n}\nexport function isHTMLImageElement(element) {\n return element.nodeName == \"IMG\";\n}\nexport function isHTMLButtonInputElement(element) {\n return element.nodeName == \"INPUT\" && element.type == \"button\";\n}\nexport function isHTMLSubmitInputElement(element) {\n return element.nodeName == \"INPUT\" && element.type == \"submit\";\n}\nexport function isHTMLResetInputElement(element) {\n return element.nodeName == \"INPUT\" && element.type == \"reset\";\n}\nexport function isHTMLButtonButtonElement(element) {\n return element.nodeName == \"BUTTON\" && element.type == \"button\";\n}\nexport function isHTMLSubmitButtonElement(element) {\n return element.nodeName == \"BUTTON\" && element.type == \"submit\";\n}\nexport function isHTMLResetButtonElement(element) {\n return element.nodeName == \"BUTTON\" && element.type == \"reset\";\n}\nexport function isTypeOfResetButtonElement(element) {\n return isHTMLResetButtonElement(element) || isHTMLResetInputElement(element);\n}\nexport function isTypeOfSubmitButtonElement(element) {\n return isHTMLSubmitButtonElement(element) || isHTMLSubmitInputElement(element);\n}\nexport function isTypeOfButtonableElement(element) {\n return isTypeOfResetButtonElement(element) || isTypeOfSubmitButtonElement(element) || isHTMLButtonButtonElement(element);\n}\nexport function isElementCheckable(element) {\n return isHTMLInputElement(element) && (element.type === \"radio\" || element.type === \"checkbox\");\n}\nexport function isTypeOfFormInputElement(element) {\n return isHTMLInputElement(element) || isHTMLSelectElement(element) || isHTMLTextAreaElement(element);\n}\nexport function createHiddenButton(type) {\n const button = document.createElement(\"button\");\n button.type = type;\n button.style.display = \"none\";\n button.dataset.sythentic = \"true\";\n return button;\n}\nexport function createHiddenInput(name, value) {\n const input = document.createElement(\"input\");\n input.type = \"hidden\";\n input.name = name;\n input.value = value;\n return input;\n}\nexport function insertElement(targetElement, insertPosition, element) {\n const createdElement = targetElement.insertAdjacentElement(insertPosition, element);\n if (!createdElement) {\n throw new Error(`Failed to insert element ${element.nodeName} into ${targetElement.nodeName}`);\n }\n return createdElement;\n}\nexport function insertHiddenInput(name, value, targetElement, insertPosition) {\n return insertElement(targetElement, insertPosition, createHiddenInput(name, value));\n}\nexport function insertHiddenButton(type, targetElement, insertPosition) {\n return insertElement(targetElement, insertPosition, createHiddenButton(type));\n}\nexport function getAllRadiosInGroup(radio) {\n const parent = radio.form || document;\n return Array.from(parent.querySelectorAll(`input[type=\"radio\"][name=\"${radio.name}\"]`));\n}\nexport function getOtherRadiosInGroup(radio) {\n return getAllRadiosInGroup(radio).filter((r) => r !== radio);\n}\nexport function isElementInViewport(el) {\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n const vertInView = rect.top <= windowHeight && rect.top + rect.height >= 0;\n const horInView = rect.left <= windowWidth && rect.left + rect.width >= 0;\n return vertInView && horInView;\n}\n", "export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = unknown> = (event: T) => void;\nexport type WildcardHandler<T = Record<string, unknown>> = (\n\ttype: keyof T,\n\tevent: T[keyof T]\n) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList<T = unknown> = Array<Handler<T>>;\nexport type WildCardEventHandlerList<T = Record<string, unknown>> = Array<\n\tWildcardHandler<T>\n>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<\n\tkeyof Events | '*',\n\tEventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>\n>;\n\nexport interface Emitter<Events extends Record<EventType, unknown>> {\n\tall: EventHandlerMap<Events>;\n\n\ton<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;\n\ton(type: '*', handler: WildcardHandler<Events>): void;\n\n\toff<Key extends keyof Events>(\n\t\ttype: Key,\n\t\thandler?: Handler<Events[Key]>\n\t): void;\n\toff(type: '*', handler: WildcardHandler<Events>): void;\n\n\temit<Key extends keyof Events>(type: Key, event: Events[Key]): void;\n\temit<Key extends keyof Events>(\n\t\ttype: undefined extends Events[Key] ? Key : never\n\t): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt<Events extends Record<EventType, unknown>>(\n\tall?: EventHandlerMap<Events>\n): Emitter<Events> {\n\ttype GenericEventHandler =\n\t\t| Handler<Events[keyof Events]>\n\t\t| WildcardHandler<Events>;\n\tall = all || new Map();\n\n\treturn {\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `'*'` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<Key extends keyof Events>(type: Key, handler: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.push(handler);\n\t\t\t} else {\n\t\t\t\tall!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * If `handler` is omitted, all handlers of the given type are removed.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)\n\t\t * @param {Function} [handler] Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<Key extends keyof Events>(type: Key, handler?: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\tif (handler) {\n\t\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tall!.set(type, []);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `'*'` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing '*' handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<Key extends keyof Events>(type: Key, evt?: Events[Key]) {\n\t\t\tlet handlers = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as EventHandlerList<Events[keyof Events]>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(evt!);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlers = all!.get('*');\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as WildCardEventHandlerList<Events>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(type, evt!);\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\n", "import mitt from \"mitt\";\nexport const EventBus = mitt();\n", "// The following code is extracted and modified from lodash v4.17.21\n// Original copyright and license information is below.\n//\n// The MIT License\n//\n// Copyright JS Foundation and other contributors <https://js.foundation/>\n//\n// Based on Underscore.js, copyright Jeremy Ashkenas,\n// DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>\n//\n// This software consists of voluntary contributions made by many\n// individuals. For exact contribution history, see the revision history\n// available at https://github.com/lodash/lodash\n//\n// The following license applies to all parts of this software except as\n// documented below:\n//\n// ====\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// ====\n//\n// Copyright and related rights for sample code are waived via CC0. Sample\n// code is defined as all source code displayed within the prose of the\n// documentation.\n//\n// CC0: http://creativecommons.org/publicdomain/zero/1.0/\n//\n// ====\n/** Used to match property names within property paths. */\nconst reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\nconst reIsPlainProp = /^\\w*$/;\nconst rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\nconst reIsUint = /^(?:0|[1-9]\\d*)$/;\nconst reEscapeChar = /\\\\(\\\\)?/g;\nconst symbolTag = \"[object Symbol]\";\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst isArray = Array.isArray;\nconst symbolProto = Symbol ? Symbol.prototype : undefined;\n// const symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\nconst symbolToString = symbolProto ? symbolProto.toString : undefined;\nconst INFINITY = 1 / 0;\nconst MAX_SAFE_INTEGER = 9007199254740991;\n// const MAX_INTEGER = 1.7976931348623157e+308;\n// const NAN = 0 / 0;\nfunction arrayMap(array, iteratee) {\n let index = -1;\n const length = array == null ? 0 : array.length;\n const result = Array(length);\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == \"string\") {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + \"\";\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : \"\";\n }\n const result = (value + \"\");\n return (result == \"0\" && (1 / value) == -INFINITY) ? \"-0\" : result;\n}\nfunction toString(value) {\n return value == null ? \"\" : baseToString(value);\n}\nexport function stringToPath(str) {\n const result = [];\n if (str.charCodeAt(0) === 46 /* . */) {\n result.push(\"\");\n }\n // @ts-ignore\n str.replace(rePropName, function (match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, \"$1\") : (number || match));\n });\n return result;\n}\nfunction defineProperty(object, key, value) {\n // @ts-ignore\n object[key] = value;\n return object;\n}\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\nfunction toKey(value) {\n if (typeof value == \"string\" || isSymbol(value)) {\n return value;\n }\n const result = (value + \"\");\n return (result == \"0\" && (1 / value) == -Infinity) ? \"-0\" : result;\n}\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n const type = typeof value;\n if (type == \"number\" || type == \"boolean\" ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\nfunction isObjectLike(value) {\n return value != null && typeof value == \"object\";\n}\nfunction isSymbol(value) {\n return typeof value == \"symbol\" ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\nfunction baseGetTag(value) {\n // @ts-ignore\n return objectToString.call(value);\n}\nfunction objectToString(value) {\n return objectProto.toString.call(value);\n}\nconst objectProto = Object.prototype;\nfunction baseGet(object, path) {\n const castedPath = castPath(path, object);\n let index = 0;\n const length = castedPath.length;\n while (object != null && index < length) {\n // @ts-ignore\n object = object[toKey(castedPath[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\nfunction isObject(value) {\n const type = typeof value;\n return value != null && (type == \"object\" || type == \"function\");\n}\nfunction isIndex(value, length = null) {\n const type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n // @ts-ignore\n return !!length && (type == \"number\" || (type != \"symbol\" && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length);\n}\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\nfunction assignValue(object, key, value) {\n // @ts-ignore\n const objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\nfunction baseAssignValue(object, key, value) {\n if (key == \"__proto__\" && defineProperty) {\n defineProperty(object, key, {\n \"configurable\": true,\n \"enumerable\": true,\n \"value\": value,\n \"writable\": true,\n });\n }\n else {\n // @ts-ignore\n object[key] = value;\n }\n}\nfunction baseSet(object, path, value) {\n if (!isObject(object)) {\n return object;\n }\n const castedPath = castPath(path, object);\n let index = -1;\n const length = castedPath.length;\n const lastIndex = length - 1;\n let nested = object;\n while (nested != null && ++index < length) {\n const key = toKey(castedPath[index]);\n let newValue = value;\n if (index != lastIndex) {\n // @ts-ignore\n const objValue = nested[key];\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(castedPath[index + 1]) ? [] : {});\n }\n assignValue(nested, key, newValue);\n // @ts-ignore\n nested = nested[key];\n }\n return object;\n}\nexport function get(object, path, defaultValue = null) {\n const result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\nexport function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n", "export function useMixin(controller, setup, teardown) {\n const controllerDisconnect = controller.disconnect.bind(controller);\n setup();\n Object.assign(controller, {\n disconnect() {\n teardown();\n controllerDisconnect();\n },\n });\n return controllerDisconnect;\n}\n", "import { debounce, wrapArray } from \"@stimulus-library/utilities\";\nimport { useMixin } from \"./use_mixin\";\nexport function useEventListener(controller, element, eventNameOrNames, handler, opts) {\n if (opts?.debounce) {\n handler = debounce(handler.bind(controller), opts.debounce);\n delete opts.debounce;\n }\n else {\n handler = handler.bind(controller);\n }\n const eventNames = wrapArray(eventNameOrNames);\n const setup = () => eventNames.forEach(eventName => element.addEventListener(eventName, handler, opts));\n const teardown = () => eventNames.forEach(eventName => element.removeEventListener(eventName, handler, opts));\n useMixin(controller, setup, teardown);\n return { setup, teardown };\n}\nexport function useEventListeners(controller, element, eventNameOrNames, handler, opts) {\n return useEventListener(controller, element, eventNameOrNames, handler, opts);\n}\nexport function useCollectionEventListener(controller, elements, eventNameOrNames, handler, opts) {\n const handlers = [];\n elements.forEach(el => {\n const { setup, teardown } = useEventListener(controller, el, eventNameOrNames, handler, opts);\n handlers.push({ setup, teardown });\n });\n return [\n () => handlers.forEach(h => h.setup()),\n () => handlers.forEach(h => h.teardown()),\n ];\n}\nexport function useCollectionEventListeners(controller, elements, eventNameOrNames, handler, opts) {\n return useCollectionEventListener(controller, elements, eventNameOrNames, handler, opts);\n}\n", "import { useMixin } from \"./use_mixin\";\nexport function useIntersectionObserver(controller, handler, options) {\n handler = handler.bind(controller);\n let observer = new IntersectionObserver(handler, options);\n const teardown = () => {\n observer?.disconnect();\n observer = null;\n };\n const observe = (element) => observer?.observe(element);\n const unobserve = (element) => observer?.unobserve(element);\n return {\n observer,\n teardown,\n observe,\n unobserve,\n };\n}\nexport function useIntersection(controller, element, appear, disappear, options) {\n if (appear) {\n appear = appear.bind(controller);\n }\n if (disappear) {\n disappear = disappear.bind(controller);\n }\n const opts = options ?? {};\n const processEntries = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n appear && appear(entry);\n }\n else {\n disappear && disappear(entry);\n }\n });\n };\n const { observer, observe, unobserve, teardown } = useIntersectionObserver(controller, processEntries, opts);\n const setup = () => observe(element);\n useMixin(controller, setup, teardown);\n return {\n observer,\n observe: () => observe(element),\n unobserve: () => unobserve(element),\n teardown,\n };\n}\n", "import { useMixin } from \"./use_mixin\";\nexport function useTimeout(controller, handler, timeout) {\n let controllerDisconnect;\n let timeoutHandle = null;\n handler = handler.bind(controller);\n const newHandler = () => {\n handler();\n timeoutHandle = null;\n Object.assign(controller, { disconnect: controllerDisconnect });\n };\n const setup = () => timeoutHandle = setTimeout(newHandler, timeout);\n const teardown = () => {\n if (timeoutHandle !== null) {\n clearTimeout(timeoutHandle);\n timeoutHandle = null;\n }\n };\n controllerDisconnect = useMixin(controller, setup, teardown);\n return teardown;\n}\n", "import { BaseController, isHTMLTextAreaElement } from \"@stimulus-library/utilities\";\nimport { useEventListener, useIntersection } from \"@stimulus-library/mixins\";\nexport class AutosizeController extends BaseController {\n connect() {\n const { teardown } = useIntersection(this, this.el, this.appear);\n this._unobserveIntersection = teardown;\n if (!isHTMLTextAreaElement(this.el)) {\n throw new Error(`Expected controller to be attached to a textarea, but was a '${this.el.tagName}'`);\n }\n requestAnimationFrame(() => {\n this.el.style.resize = \"none\";\n this.el.style.boxSizing = \"border-box\";\n this._handler();\n useEventListener(this, window, [\"resize\"], this._handler);\n useEventListener(this, this.el, [\"input\", \"change\", \"focus\"], this._handler, { debounce: 100 });\n });\n }\n appear(_entry) {\n this.autosize(this.el);\n this._unobserveIntersection();\n }\n _handler() {\n this.autosize(this.el);\n }\n autosize(element) {\n const offset = element.offsetHeight - element.clientHeight;\n element.style.height = \"auto\";\n element.style.height = element.scrollHeight + offset + \"px\";\n }\n}\n", "/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n", "/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date(date: DateType): DateType {\n * return constructFrom(\n * date, // Use contrustor from the given date\n * date.getTime() // Use the date value to create a new date\n * )\n * }\n */\nexport function constructFrom(date, value) {\n if (date instanceof Date) {\n return new date.constructor(value);\n } else {\n return new Date(value);\n }\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n", "import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n", "import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n const dayOfMonth = _date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n const endOfDesiredMonth = constructFrom(date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n _date.setFullYear(\n endOfDesiredMonth.getFullYear(),\n endOfDesiredMonth.getMonth(),\n dayOfMonth,\n );\n return _date;\n }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n", "import { addDays } from \"./addDays.mjs\";\nimport { addMonths } from \"./addMonths.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.\n *\n * | Key | Description |\n * |----------------|------------------------------------|\n * | years | Amount of years to be added |\n * | months | Amount of months to be added |\n * | weeks | Amount of weeks to be added |\n * | days | Amount of days to be added |\n * | hours | Amount of hours to be added |\n * | minutes | Amount of minutes to be added |\n * | seconds | Amount of seconds to be added |\n *\n * All values default to 0\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\\\\-7\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nexport function add(date, duration) {\n const {\n years = 0,\n months = 0,\n weeks = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n } = duration;\n\n // Add years and months\n const _date = toDate(date);\n const dateWithMonths =\n months || years ? addMonths(_date, months + years * 12) : _date;\n\n // Add weeks and days\n const dateWithDays =\n days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n // Add days, hours, minutes and seconds\n const minutesToAdd = minutes + hours * 60;\n const secondsToAdd = seconds + minutesToAdd * 60;\n const msToAdd = secondsToAdd * 1000;\n const finalDate = constructFrom(date, dateWithDays.getTime() + msToAdd);\n\n return finalDate;\n}\n\n// Fallback for modularized imports:\nexport default add;\n", "/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n", "import { toDate } from \"../toDate.mjs\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n", "import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n", "import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full days according to the local timezone\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n *\n * @example\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 1)\n * )\n * //=> 92\n */\nexport function differenceInDays(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareLocalAsc(_dateLeft, _dateRight);\n const difference = Math.abs(differenceInCalendarDays(_dateLeft, _dateRight));\n\n _dateLeft.setDate(_dateLeft.getDate() - sign * difference);\n\n // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n const isLastDayNotFull = Number(\n compareLocalAsc(_dateLeft, _dateRight) === -sign,\n );\n const result = sign * (difference - isLastDayNotFull);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\nfunction compareLocalAsc(dateLeft, dateRight) {\n const diff =\n dateLeft.getFullYear() - dateRight.getFullYear() ||\n dateLeft.getMonth() - dateRight.getMonth() ||\n dateLeft.getDate() - dateRight.getDate() ||\n dateLeft.getHours() - dateRight.getHours() ||\n dateLeft.getMinutes() - dateRight.getMinutes() ||\n dateLeft.getSeconds() - dateRight.getSeconds() ||\n dateLeft.getMilliseconds() - dateRight.getMilliseconds();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n// Fallback for modularized imports:\nexport default differenceInDays;\n", "export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(dateLeft, dateRight) {\n return +toDate(dateLeft) - +toDate(dateRight);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n", "import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { millisecondsInHour } from \"./constants.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInHours} function options.\n */\n\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport function differenceInHours(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInHours;\n", "import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { millisecondsInMinute } from \"./constants.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInMinutes} function options.\n */\n\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport function differenceInMinutes(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMinutes;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const diff = _dateLeft.getTime() - _dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear();\n const monthDiff = _dateLeft.getMonth() - _dateRight.getMonth();\n\n return yearDiff * 12 + monthDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The end of a day\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport function endOfDay(date) {\n const _date = toDate(date);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfDay;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date) {\n const _date = toDate(date);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n", "import { endOfDay } from \"./endOfDay.mjs\";\nimport { endOfMonth } from \"./endOfMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n\n * @returns The date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport function isLastDayOfMonth(date) {\n const _date = toDate(date);\n return +endOfDay(_date) === +endOfMonth(_date);\n}\n\n// Fallback for modularized imports:\nexport default isLastDayOfMonth;\n", "import { compareAsc } from \"./compareAsc.mjs\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.mjs\";\nimport { isLastDayOfMonth } from \"./isLastDayOfMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates using trunc as a default rounding method.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport function differenceInMonths(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareAsc(_dateLeft, _dateRight);\n const difference = Math.abs(\n differenceInCalendarMonths(_dateLeft, _dateRight),\n );\n let result;\n\n // Check for the difference of less than month\n if (difference < 1) {\n result = 0;\n } else {\n if (_dateLeft.getMonth() === 1 && _dateLeft.getDate() > 27) {\n // This will check if the date is end of Feb and assign a higher end of month date\n // to compare it with Jan\n _dateLeft.setDate(30);\n }\n\n _dateLeft.setMonth(_dateLeft.getMonth() - sign * difference);\n\n // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n let isLastMonthNotFull = compareAsc(_dateLeft, _dateRight) === -sign;\n\n // Check for cases of one full calendar month\n if (\n isLastDayOfMonth(toDate(dateLeft)) &&\n difference === 1 &&\n compareAsc(dateLeft, _dateRight) === 1\n ) {\n isLastMonthNotFull = false;\n }\n\n result = sign * (difference - Number(isLastMonthNotFull));\n }\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInMonths;\n", "import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(dateLeft, dateRight, options) {\n const diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n\n * @returns The number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nexport function differenceInCalendarYears(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n return _dateLeft.getFullYear() - _dateRight.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarYears;\n", "import { compareAsc } from \"./compareAsc.mjs\";\nimport { differenceInCalendarYears } from \"./differenceInCalendarYears.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full years\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\nexport function differenceInYears(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareAsc(_dateLeft, _dateRight);\n const difference = Math.abs(differenceInCalendarYears(_dateLeft, _dateRight));\n\n // Set both dates to a valid leap year for accurate comparison when dealing\n // with leap days\n _dateLeft.setFullYear(1584);\n _dateRight.setFullYear(1584);\n\n // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n const isLastYearNotFull = compareAsc(_dateLeft, _dateRight) === -sign;\n const result = sign * (difference - +isLastYearNotFull);\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInYears;\n", "import { add } from \"./add.mjs\";\nimport { differenceInDays } from \"./differenceInDays.mjs\";\nimport { differenceInHours } from \"./differenceInHours.mjs\";\nimport { differenceInMinutes } from \"./differenceInMinutes.mjs\";\nimport { differenceInMonths } from \"./differenceInMonths.mjs\";\nimport { differenceInSeconds } from \"./differenceInSeconds.mjs\";\nimport { differenceInYears } from \"./differenceInYears.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name intervalToDuration\n * @category Common Helpers\n * @summary Convert interval to duration\n *\n * @description\n * Convert a interval object to a duration object.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param interval - The interval to convert to duration\n *\n * @returns The duration object\n *\n * @example\n * // Get the duration between January 15, 1929 and April 4, 1968.\n * intervalToDuration({\n * start: new Date(1929, 0, 15, 12, 0, 0),\n * end: new Date(1968, 3, 4, 19, 5, 0)\n * })\n * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }\n */\nexport function intervalToDuration(interval) {\n const start = toDate(interval.start);\n const end = toDate(interval.end);\n\n const duration = {};\n\n const years = differenceInYears(end, start);\n if (years) duration.years = years;\n\n const remainingMonths = add(start, { years: duration.years });\n\n const months = differenceInMonths(end, remainingMonths);\n if (months) duration.months = months;\n\n const remainingDays = add(remainingMonths, { months: duration.months });\n\n const days = differenceInDays(end, remainingDays);\n if (days) duration.days = days;\n\n const remainingHours = add(remainingDays, { days: duration.days });\n\n const hours = differenceInHours(end, remainingHours);\n if (hours) duration.hours = hours;\n\n const remainingMinutes = add(remainingHours, { hours: duration.hours });\n\n const minutes = differenceInMinutes(end, remainingMinutes);\n if (minutes) duration.minutes = minutes;\n\n const remainingSeconds = add(remainingMinutes, { minutes: duration.minutes });\n\n const seconds = differenceInSeconds(end, remainingSeconds);\n if (seconds) duration.seconds = seconds;\n\n return duration;\n}\n\n// Fallback for modularized imports:\nexport default intervalToDuration;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isPast\n * @category Common Helpers\n * @summary Is the given date in the past?\n * @pure false\n *\n * @description\n * Is the given date in the past?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is in the past\n *\n * @example\n * // If today is 6 October 2014, is 2 July 2014 in the past?\n * const result = isPast(new Date(2014, 6, 2))\n * //=> true\n */\nexport function isPast(date) {\n return +toDate(date) < Date.now();\n}\n\n// Fallback for modularized imports:\nexport default isPast;\n", "const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n", "export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n", "import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n", "const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n", "/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n", "import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n", "export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n", "export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n", "import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n", "import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n", "let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n", "import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday<DateType extends Date>(\n * date: DateType | number | string,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n", "import { compareAsc } from \"./compareAsc.mjs\";\nimport { minutesInDay, minutesInMonth } from \"./constants.mjs\";\nimport { differenceInMonths } from \"./differenceInMonths.mjs\";\nimport { differenceInSeconds } from \"./differenceInSeconds.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * The {@link formatDistance} function options.\n */\n\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date\n * @param baseDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\n\nexport function formatDistance(date, baseDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n const minutesInAlmostTwoDays = 2520;\n\n const comparison = compareAsc(date, baseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n let dateLeft;\n let dateRight;\n if (comparison > 0) {\n dateLeft = toDate(baseDate);\n dateRight = toDate(date);\n } else {\n dateLeft = toDate(date);\n dateRight = toDate(baseDate);\n }\n\n const seconds = differenceInSeconds(dateRight, dateLeft);\n const offsetInSeconds =\n (getTimezoneOffsetInMilliseconds(dateRight) -\n getTimezoneOffsetInMilliseconds(dateLeft)) /\n 1000;\n const minutes = Math.round((seconds - offsetInSeconds) / 60);\n let months;\n\n // 0 up to 2 mins\n if (minutes < 2) {\n if (options?.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance(\"lessThanXSeconds\", 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance(\"lessThanXSeconds\", 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance(\"lessThanXSeconds\", 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance(\"halfAMinute\", 0, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n }\n }\n\n // 2 mins up to 0.75 hrs\n } else if (minutes < 45) {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n\n // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance(\"aboutXHours\", 1, localizeOptions);\n\n // 1.5 hrs up to 24 hrs\n } else if (minutes < minutesInDay) {\n const hours = Math.round(minutes / 60);\n return locale.formatDistance(\"aboutXHours\", hours, localizeOptions);\n\n // 1 day up to 1.75 days\n } else if (minutes < minutesInAlmostTwoDays) {\n return locale.formatDistance(\"xDays\", 1, localizeOptions);\n\n // 1.75 days up to 30 days\n } else if (minutes < minutesInMonth) {\n const days = Math.round(minutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 month up to 2 months\n } else if (minutes < minutesInMonth * 2) {\n months = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"aboutXMonths\", months, localizeOptions);\n }\n\n months = differenceInMonths(dateRight, dateLeft);\n\n // 2 months up to 12 months\n if (months < 12) {\n const nearestMonth = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"xMonths\", nearestMonth, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const monthsSinceStartOfYear = months % 12;\n const years = Math.trunc(months / 12);\n\n // N years up to 1 years 3 months\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance(\"aboutXYears\", years, localizeOptions);\n\n // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance(\"overXYears\", years, localizeOptions);\n\n // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance(\"almostXYears\", years + 1, localizeOptions);\n }\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistance;\n", "import { constructNow } from \"./constructNow.mjs\";\nimport { formatDistance } from \"./formatDistance.mjs\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n", "import { formatDistanceToNow } from \"date-fns/formatDistanceToNow\";\nimport { intervalToDuration } from \"date-fns/intervalToDuration\";\nimport { isPast } from \"date-fns/isPast\";\nimport { toDate } from \"date-fns/toDate\";\nimport { BaseController } from \"@stimulus-library/utilities\";\nimport { useTimeout } from \"@stimulus-library/mixins\";\nexport class TimeDistanceController extends BaseController {\n static values = {\n timestamp: Number,\n };\n get _duration() {\n return isPast(this._timestamp) ? intervalToDuration({ start: this._timestamp, end: new Date() }) : intervalToDuration({ start: new Date(), end: this._timestamp });\n }\n get _nextUpdate() {\n const duration = this._duration;\n if (duration.years && duration.years > 0) {\n return null;\n }\n else if (duration.months && duration.months > 0) {\n return null;\n }\n else if (duration.days && duration.days > 0) {\n return null;\n }\n else if (duration.hours && duration.hours > 0) {\n return 1800000; // Update every 30 mins\n }\n else {\n return 30000; // Update every 30 seconds\n }\n }\n timestampValueChanged() {\n this._timestamp = toDate(this.timestampValue * 1000);\n }\n connect() {\n if (!this.hasTimestampValue) {\n throw new Error(\"Expected `timestampValue` to be present\");\n }\n this._update();\n }\n _update() {\n this.el.innerHTML = formatDistanceToNow(this._timestamp, {\n addSuffix: true,\n includeSeconds: true,\n });\n if (this._nextUpdate) {\n useTimeout(this, this._update, this._nextUpdate);\n }\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport class WeighInController extends Controller<HTMLLinkElement> {\n connect(): void {\n document.addEventListener('keydown', this.onKeyDown)\n }\n\n disconnect(): void {\n document.removeEventListener('keydown', this.onKeyDown)\n }\n\n private onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'w') {\n this.element.click()\n }\n }\n}\n", "export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];", "export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}", "export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}", "import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };", "import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};", "import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}", "export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;", "export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}", "import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}", "import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}", "import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}", "import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}", "import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}", "import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}", "import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}", "import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}", "export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}", "import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}", "export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}", "import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}", "export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};", "export default function getVariation(placement) {\n return placement.split('-')[1];\n}", "import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};", "import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};", "var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}", "var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}", "import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If <html> has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on <html>\n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}", "import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}", "import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}", "import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}", "import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}", "export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}", "import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}", "import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}", "import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}", "import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}", "import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases \u2013 research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};", "import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};", "import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};", "export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}", "import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};", "export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}", "import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}", "export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}", "export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}", "import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update \u2013 it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update \u2013 it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";", "export const ROUND_ARROW =\n '<svg width=\"16\" height=\"6\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z\"></svg>';\n\nexport const BOX_CLASS = `__NAMESPACE_PREFIX__-box`;\nexport const CONTENT_CLASS = `__NAMESPACE_PREFIX__-content`;\nexport const BACKDROP_CLASS = `__NAMESPACE_PREFIX__-backdrop`;\nexport const ARROW_CLASS = `__NAMESPACE_PREFIX__-arrow`;\nexport const SVG_ARROW_CLASS = `__NAMESPACE_PREFIX__-svg-arrow`;\n\nexport const TOUCH_OPTIONS = {passive: true, capture: true};\n\nexport const TIPPY_DEFAULT_APPEND_TO = () => document.body;\n", "import {BasePlacement, Placement} from './types';\n\nexport function hasOwnProperty(\n obj: Record<string, unknown>,\n key: string\n): boolean {\n return {}.hasOwnProperty.call(obj, key);\n}\n\nexport function getValueAtIndexOrReturn<T>(\n value: T | [T | null, T | null],\n index: number,\n defaultValue: T | [T, T]\n): T {\n if (Array.isArray(value)) {\n const v = value[index];\n return v == null\n ? Array.isArray(defaultValue)\n ? defaultValue[index]\n : defaultValue\n : v;\n }\n\n return value;\n}\n\nexport function isType(value: any, type: string): boolean {\n const str = {}.toString.call(value);\n return str.indexOf('[object') === 0 && str.indexOf(`${type}]`) > -1;\n}\n\nexport function invokeWithArgsOrReturn(value: any, args: any[]): any {\n return typeof value === 'function' ? value(...args) : value;\n}\n\nexport function debounce<T>(\n fn: (arg: T) => void,\n ms: number\n): (arg: T) => void {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n\n let timeout: any;\n\n return (arg): void => {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n fn(arg);\n }, ms);\n };\n}\n\nexport function removeProperties<T>(obj: T, keys: string[]): Partial<T> {\n const clone = {...obj};\n keys.forEach((key) => {\n delete (clone as any)[key];\n });\n return clone;\n}\n\nexport function splitBySpaces(value: string): string[] {\n return value.split(/\\s+/).filter(Boolean);\n}\n\nexport function normalizeToArray<T>(value: T | T[]): T[] {\n return ([] as T[]).concat(value);\n}\n\nexport function pushIfUnique<T>(arr: T[], value: T): void {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n }\n}\n\nexport function appendPxIfNumber(value: string | number): string {\n return typeof value === 'number' ? `${value}px` : value;\n}\n\nexport function unique<T>(arr: T[]): T[] {\n return arr.filter((item, index) => arr.indexOf(item) === index);\n}\n\nexport function getNumber(value: string | number): number {\n return typeof value === 'number' ? value : parseFloat(value);\n}\n\nexport function getBasePlacement(placement: Placement): BasePlacement {\n return placement.split('-')[0] as BasePlacement;\n}\n\nexport function arrayFrom(value: ArrayLike<any>): any[] {\n return [].slice.call(value);\n}\n\nexport function removeUndefinedProps(\n obj: Record<string, unknown>\n): Partial<Record<string, unknown>> {\n return Object.keys(obj).reduce((acc, key) => {\n if (obj[key] !== undefined) {\n (acc as any)[key] = obj[key];\n }\n\n return acc;\n }, {});\n}\n", "import {ReferenceElement, Targets} from './types';\nimport {PopperTreeData} from './types-internal';\nimport {arrayFrom, isType, normalizeToArray, getBasePlacement} from './utils';\n\nexport function div(): HTMLDivElement {\n return document.createElement('div');\n}\n\nexport function isElement(value: unknown): value is Element | DocumentFragment {\n return ['Element', 'Fragment'].some((type) => isType(value, type));\n}\n\nexport function isNodeList(value: unknown): value is NodeList {\n return isType(value, 'NodeList');\n}\n\nexport function isMouseEvent(value: unknown): value is MouseEvent {\n return isType(value, 'MouseEvent');\n}\n\nexport function isReferenceElement(value: any): value is ReferenceElement {\n return !!(value && value._tippy && value._tippy.reference === value);\n}\n\nexport function getArrayOfElements(value: Targets): Element[] {\n if (isElement(value)) {\n return [value];\n }\n\n if (isNodeList(value)) {\n return arrayFrom(value);\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n return arrayFrom(document.querySelectorAll(value));\n}\n\nexport function setTransitionDuration(\n els: (HTMLDivElement | null)[],\n value: number\n): void {\n els.forEach((el) => {\n if (el) {\n el.style.transitionDuration = `${value}ms`;\n }\n });\n}\n\nexport function setVisibilityState(\n els: (HTMLDivElement | null)[],\n state: 'visible' | 'hidden'\n): void {\n els.forEach((el) => {\n if (el) {\n el.setAttribute('data-state', state);\n }\n });\n}\n\nexport function getOwnerDocument(\n elementOrElements: Element | Element[]\n): Document {\n const [element] = normalizeToArray(elementOrElements);\n\n // Elements created via a <template> have an ownerDocument with no reference to the body\n return element?.ownerDocument?.body ? element.ownerDocument : document;\n}\n\nexport function isCursorOutsideInteractiveBorder(\n popperTreeData: PopperTreeData[],\n event: MouseEvent\n): boolean {\n const {clientX, clientY} = event;\n\n return popperTreeData.every(({popperRect, popperState, props}) => {\n const {interactiveBorder} = props;\n const basePlacement = getBasePlacement(popperState.placement);\n const offsetData = popperState.modifiersData.offset;\n\n if (!offsetData) {\n return true;\n }\n\n const topDistance = basePlacement === 'bottom' ? offsetData.top!.y : 0;\n const bottomDistance = basePlacement === 'top' ? offsetData.bottom!.y : 0;\n const leftDistance = basePlacement === 'right' ? offsetData.left!.x : 0;\n const rightDistance = basePlacement === 'left' ? offsetData.right!.x : 0;\n\n const exceedsTop =\n popperRect.top - clientY + topDistance > interactiveBorder;\n const exceedsBottom =\n clientY - popperRect.bottom - bottomDistance > interactiveBorder;\n const exceedsLeft =\n popperRect.left - clientX + leftDistance > interactiveBorder;\n const exceedsRight =\n clientX - popperRect.right - rightDistance > interactiveBorder;\n\n return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;\n });\n}\n\nexport function updateTransitionEndListener(\n box: HTMLDivElement,\n action: 'add' | 'remove',\n listener: (event: TransitionEvent) => void\n): void {\n const method = `${action}EventListener` as\n | 'addEventListener'\n | 'removeEventListener';\n\n // some browsers apparently support `transition` (unprefixed) but only fire\n // `webkitTransitionEnd`...\n ['transitionend', 'webkitTransitionEnd'].forEach((event) => {\n box[method](event, listener as EventListener);\n });\n}\n\n/**\n * Compared to xxx.contains, this function works for dom structures with shadow\n * dom\n */\nexport function actualContains(parent: Element, child: Element): boolean {\n let target = child;\n while (target) {\n if (parent.contains(target)) {\n return true;\n }\n target = (target.getRootNode?.() as any)?.host;\n }\n return false;\n}\n", "import {TOUCH_OPTIONS} from './constants';\nimport {isReferenceElement} from './dom-utils';\n\nexport const currentInput = {isTouch: false};\nlet lastMouseMoveTime = 0;\n\n/**\n * When a `touchstart` event is fired, it's assumed the user is using touch\n * input. We'll bind a `mousemove` event listener to listen for mouse input in\n * the future. This way, the `isTouch` property is fully dynamic and will handle\n * hybrid devices that use a mix of touch + mouse input.\n */\nexport function onDocumentTouchStart(): void {\n if (currentInput.isTouch) {\n return;\n }\n\n currentInput.isTouch = true;\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}\n\n/**\n * When two `mousemove` event are fired consecutively within 20ms, it's assumed\n * the user is using mouse input again. `mousemove` can fire on touch devices as\n * well, but very rarely that quickly.\n */\nexport function onDocumentMouseMove(): void {\n const now = performance.now();\n\n if (now - lastMouseMoveTime < 20) {\n currentInput.isTouch = false;\n\n document.removeEventListener('mousemove', onDocumentMouseMove);\n }\n\n lastMouseMoveTime = now;\n}\n\n/**\n * When an element is in focus and has a tippy, leaving the tab/window and\n * returning causes it to show again. For mouse users this is unexpected, but\n * for keyboard use it makes sense.\n * TODO: find a better technique to solve this problem\n */\nexport function onWindowBlur(): void {\n const activeElement = document.activeElement as HTMLElement | null;\n\n if (isReferenceElement(activeElement)) {\n const instance = activeElement._tippy!;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}\n\nexport default function bindGlobalEventListeners(): void {\n document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);\n window.addEventListener('blur', onWindowBlur);\n}\n", "export const isBrowser =\n typeof window !== 'undefined' && typeof document !== 'undefined';\n\nexport const isIE11 = isBrowser\n ? // @ts-ignore\n !!window.msCrypto\n : false;\n", "import {Targets} from './types';\n\nexport function createMemoryLeakWarning(method: string): string {\n const txt = method === 'destroy' ? 'n already-' : ' ';\n\n return [\n `${method}() was called on a${txt}destroyed instance. This is a no-op but`,\n 'indicates a potential memory leak.',\n ].join(' ');\n}\n\nexport function clean(value: string): string {\n const spacesAndTabs = /[ \\t]{2,}/g;\n const lineStartWithSpaces = /^[ \\t]*/gm;\n\n return value\n .replace(spacesAndTabs, ' ')\n .replace(lineStartWithSpaces, '')\n .trim();\n}\n\nfunction getDevMessage(message: string): string {\n return clean(`\n %ctippy.js\n\n %c${clean(message)}\n\n %c👷 This is a development-only message. It will be removed in production.\n `);\n}\n\nexport function getFormattedMessage(message: string): string[] {\n return [\n getDevMessage(message),\n // title\n 'color: #00C584; font-size: 1.3em; font-weight: bold;',\n // message\n 'line-height: 1.5',\n // footer\n 'color: #a6a095;',\n ];\n}\n\n// Assume warnings and errors never have the same message\nlet visitedMessages: Set<string>;\nif (__DEV__) {\n resetVisitedMessages();\n}\n\nexport function resetVisitedMessages(): void {\n visitedMessages = new Set();\n}\n\nexport function warnWhen(condition: boolean, message: string): void {\n if (condition && !visitedMessages.has(message)) {\n visitedMessages.add(message);\n console.warn(...getFormattedMessage(message));\n }\n}\n\nexport function errorWhen(condition: boolean, message: string): void {\n if (condition && !visitedMessages.has(message)) {\n visitedMessages.add(message);\n console.error(...getFormattedMessage(message));\n }\n}\n\nexport function validateTargets(targets: Targets): void {\n const didPassFalsyValue = !targets;\n const didPassPlainObject =\n Object.prototype.toString.call(targets) === '[object Object]' &&\n !(targets as any).addEventListener;\n\n errorWhen(\n didPassFalsyValue,\n [\n 'tippy() was passed',\n '`' + String(targets) + '`',\n 'as its targets (first) argument. Valid types are: String, Element,',\n 'Element[], or NodeList.',\n ].join(' ')\n );\n\n errorWhen(\n didPassPlainObject,\n [\n 'tippy() was passed a plain object which is not supported as an argument',\n 'for virtual positioning. Use props.getReferenceClientRect instead.',\n ].join(' ')\n );\n}\n", "import {DefaultProps, Plugin, Props, ReferenceElement, Tippy} from './types';\nimport {\n hasOwnProperty,\n removeProperties,\n invokeWithArgsOrReturn,\n} from './utils';\nimport {warnWhen} from './validation';\nimport {TIPPY_DEFAULT_APPEND_TO} from './constants';\n\nconst pluginProps = {\n animateFill: false,\n followCursor: false,\n inlinePositioning: false,\n sticky: false,\n};\n\nconst renderProps = {\n allowHTML: false,\n animation: 'fade',\n arrow: true,\n content: '',\n inertia: false,\n maxWidth: 350,\n role: 'tooltip',\n theme: '',\n zIndex: 9999,\n};\n\nexport const defaultProps: DefaultProps = {\n appendTo: TIPPY_DEFAULT_APPEND_TO,\n aria: {\n content: 'auto',\n expanded: 'auto',\n },\n delay: 0,\n duration: [300, 250],\n getReferenceClientRect: null,\n hideOnClick: true,\n ignoreAttributes: false,\n interactive: false,\n interactiveBorder: 2,\n interactiveDebounce: 0,\n moveTransition: '',\n offset: [0, 10],\n onAfterUpdate() {},\n onBeforeUpdate() {},\n onCreate() {},\n onDestroy() {},\n onHidden() {},\n onHide() {},\n onMount() {},\n onShow() {},\n onShown() {},\n onTrigger() {},\n onUntrigger() {},\n onClickOutside() {},\n placement: 'top',\n plugins: [],\n popperOptions: {},\n render: null,\n showOnCreate: false,\n touch: true,\n trigger: 'mouseenter focus',\n triggerTarget: null,\n ...pluginProps,\n ...renderProps,\n};\n\nconst defaultKeys = Object.keys(defaultProps);\n\nexport const setDefaultProps: Tippy['setDefaultProps'] = (partialProps) => {\n /* istanbul ignore else */\n if (__DEV__) {\n validateProps(partialProps, []);\n }\n\n const keys = Object.keys(partialProps) as Array<keyof DefaultProps>;\n keys.forEach((key) => {\n (defaultProps as any)[key] = partialProps[key];\n });\n};\n\nexport function getExtendedPassedProps(\n passedProps: Partial<Props> & Record<string, unknown>\n): Partial<Props> {\n const plugins = passedProps.plugins || [];\n const pluginProps = plugins.reduce<Record<string, unknown>>((acc, plugin) => {\n const {name, defaultValue} = plugin;\n\n if (name) {\n acc[name] =\n passedProps[name] !== undefined\n ? passedProps[name]\n : (defaultProps as any)[name] ?? defaultValue;\n }\n\n return acc;\n }, {});\n\n return {\n ...passedProps,\n ...pluginProps,\n };\n}\n\nexport function getDataAttributeProps(\n reference: ReferenceElement,\n plugins: Plugin[]\n): Record<string, unknown> {\n const propKeys = plugins\n ? Object.keys(getExtendedPassedProps({...defaultProps, plugins}))\n : defaultKeys;\n\n const props = propKeys.reduce(\n (acc: Partial<Props> & Record<string, unknown>, key) => {\n const valueAsString = (\n reference.getAttribute(`data-tippy-${key}`) || ''\n ).trim();\n\n if (!valueAsString) {\n return acc;\n }\n\n if (key === 'content') {\n acc[key] = valueAsString;\n } else {\n try {\n acc[key] = JSON.parse(valueAsString);\n } catch (e) {\n acc[key] = valueAsString;\n }\n }\n\n return acc;\n },\n {}\n );\n\n return props;\n}\n\nexport function evaluateProps(\n reference: ReferenceElement,\n props: Props\n): Props {\n const out = {\n ...props,\n content: invokeWithArgsOrReturn(props.content, [reference]),\n ...(props.ignoreAttributes\n ? {}\n : getDataAttributeProps(reference, props.plugins)),\n };\n\n out.aria = {\n ...defaultProps.aria,\n ...out.aria,\n };\n\n out.aria = {\n expanded:\n out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,\n content:\n out.aria.content === 'auto'\n ? props.interactive\n ? null\n : 'describedby'\n : out.aria.content,\n };\n\n return out;\n}\n\nexport function validateProps(\n partialProps: Partial<Props> = {},\n plugins: Plugin[] = []\n): void {\n const keys = Object.keys(partialProps) as Array<keyof Props>;\n keys.forEach((prop) => {\n const nonPluginProps = removeProperties(\n defaultProps,\n Object.keys(pluginProps)\n );\n\n let didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop);\n\n // Check if the prop exists in `plugins`\n if (didPassUnknownProp) {\n didPassUnknownProp =\n plugins.filter((plugin) => plugin.name === prop).length === 0;\n }\n\n warnWhen(\n didPassUnknownProp,\n [\n `\\`${prop}\\``,\n \"is not a valid prop. You may have spelled it incorrectly, or if it's\",\n 'a plugin, forgot to pass it in an array as props.plugins.',\n '\\n\\n',\n 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\\n',\n 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/',\n ].join(' ')\n );\n });\n}\n", "import {\n ARROW_CLASS,\n BACKDROP_CLASS,\n BOX_CLASS,\n CONTENT_CLASS,\n SVG_ARROW_CLASS,\n} from './constants';\nimport {div, isElement} from './dom-utils';\nimport {Instance, PopperElement, Props} from './types';\nimport {PopperChildren} from './types-internal';\nimport {arrayFrom} from './utils';\n\n// Firefox extensions don't allow .innerHTML = \"...\" property. This tricks it.\nconst innerHTML = (): 'innerHTML' => 'innerHTML';\n\nfunction dangerouslySetInnerHTML(element: Element, html: string): void {\n element[innerHTML()] = html;\n}\n\nfunction createArrowElement(value: Props['arrow']): HTMLDivElement {\n const arrow = div();\n\n if (value === true) {\n arrow.className = ARROW_CLASS;\n } else {\n arrow.className = SVG_ARROW_CLASS;\n\n if (isElement(value)) {\n arrow.appendChild(value);\n } else {\n dangerouslySetInnerHTML(arrow, value as string);\n }\n }\n\n return arrow;\n}\n\nexport function setContent(content: HTMLDivElement, props: Props): void {\n if (isElement(props.content)) {\n dangerouslySetInnerHTML(content, '');\n content.appendChild(props.content);\n } else if (typeof props.content !== 'function') {\n if (props.allowHTML) {\n dangerouslySetInnerHTML(content, props.content);\n } else {\n content.textContent = props.content;\n }\n }\n}\n\nexport function getChildren(popper: PopperElement): PopperChildren {\n const box = popper.firstElementChild as HTMLDivElement;\n const boxChildren = arrayFrom(box.children);\n\n return {\n box,\n content: boxChildren.find((node) => node.classList.contains(CONTENT_CLASS)),\n arrow: boxChildren.find(\n (node) =>\n node.classList.contains(ARROW_CLASS) ||\n node.classList.contains(SVG_ARROW_CLASS)\n ),\n backdrop: boxChildren.find((node) =>\n node.classList.contains(BACKDROP_CLASS)\n ),\n };\n}\n\nexport function render(\n instance: Instance\n): {\n popper: PopperElement;\n onUpdate?: (prevProps: Props, nextProps: Props) => void;\n} {\n const popper = div();\n\n const box = div();\n box.className = BOX_CLASS;\n box.setAttribute('data-state', 'hidden');\n box.setAttribute('tabindex', '-1');\n\n const content = div();\n content.className = CONTENT_CLASS;\n content.setAttribute('data-state', 'hidden');\n\n setContent(content, instance.props);\n\n popper.appendChild(box);\n box.appendChild(content);\n\n onUpdate(instance.props, instance.props);\n\n function onUpdate(prevProps: Props, nextProps: Props): void {\n const {box, content, arrow} = getChildren(popper);\n\n if (nextProps.theme) {\n box.setAttribute('data-theme', nextProps.theme);\n } else {\n box.removeAttribute('data-theme');\n }\n\n if (typeof nextProps.animation === 'string') {\n box.setAttribute('data-animation', nextProps.animation);\n } else {\n box.removeAttribute('data-animation');\n }\n\n if (nextProps.inertia) {\n box.setAttribute('data-inertia', '');\n } else {\n box.removeAttribute('data-inertia');\n }\n\n box.style.maxWidth =\n typeof nextProps.maxWidth === 'number'\n ? `${nextProps.maxWidth}px`\n : nextProps.maxWidth;\n\n if (nextProps.role) {\n box.setAttribute('role', nextProps.role);\n } else {\n box.removeAttribute('role');\n }\n\n if (\n prevProps.content !== nextProps.content ||\n prevProps.allowHTML !== nextProps.allowHTML\n ) {\n setContent(content, instance.props);\n }\n\n if (nextProps.arrow) {\n if (!arrow) {\n box.appendChild(createArrowElement(nextProps.arrow));\n } else if (prevProps.arrow !== nextProps.arrow) {\n box.removeChild(arrow);\n box.appendChild(createArrowElement(nextProps.arrow));\n }\n } else if (arrow) {\n box.removeChild(arrow!);\n }\n }\n\n return {\n popper,\n onUpdate,\n };\n}\n\n// Runtime check to identify if the render function is the default one; this\n// way we can apply default CSS transitions logic and it can be tree-shaken away\nrender.$$tippy = true;\n", "import {createPopper, StrictModifiers, Modifier} from '@popperjs/core';\nimport {currentInput} from './bindGlobalEventListeners';\nimport {isIE11} from './browser';\nimport {TIPPY_DEFAULT_APPEND_TO, TOUCH_OPTIONS} from './constants';\nimport {\n actualContains,\n div,\n getOwnerDocument,\n isCursorOutsideInteractiveBorder,\n isMouseEvent,\n setTransitionDuration,\n setVisibilityState,\n updateTransitionEndListener,\n} from './dom-utils';\nimport {defaultProps, evaluateProps, getExtendedPassedProps} from './props';\nimport {getChildren} from './template';\nimport {\n Content,\n Instance,\n LifecycleHooks,\n PopperElement,\n Props,\n ReferenceElement,\n} from './types';\nimport {ListenerObject, PopperTreeData, PopperChildren} from './types-internal';\nimport {\n arrayFrom,\n debounce,\n getValueAtIndexOrReturn,\n invokeWithArgsOrReturn,\n normalizeToArray,\n pushIfUnique,\n splitBySpaces,\n unique,\n removeUndefinedProps,\n} from './utils';\nimport {createMemoryLeakWarning, errorWhen, warnWhen} from './validation';\n\nlet idCounter = 1;\nlet mouseMoveListeners: ((event: MouseEvent) => void)[] = [];\n\n// Used by `hideAll()`\nexport let mountedInstances: Instance[] = [];\n\nexport default function createTippy(\n reference: ReferenceElement,\n passedProps: Partial<Props>\n): Instance {\n const props = evaluateProps(reference, {\n ...defaultProps,\n ...getExtendedPassedProps(removeUndefinedProps(passedProps)),\n });\n\n // ===========================================================================\n // 🔒 Private members\n // ===========================================================================\n let showTimeout: any;\n let hideTimeout: any;\n let scheduleHideAnimationFrame: number;\n let isVisibleFromClick = false;\n let didHideDueToDocumentMouseDown = false;\n let didTouchMove = false;\n let ignoreOnFirstUpdate = false;\n let lastTriggerEvent: Event | undefined;\n let currentTransitionEndListener: (event: TransitionEvent) => void;\n let onFirstUpdate: () => void;\n let listeners: ListenerObject[] = [];\n let debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce);\n let currentTarget: Element;\n\n // ===========================================================================\n // 🔑 Public members\n // ===========================================================================\n const id = idCounter++;\n const popperInstance = null;\n const plugins = unique(props.plugins);\n\n const state = {\n // Is the instance currently enabled?\n isEnabled: true,\n // Is the tippy currently showing and not transitioning out?\n isVisible: false,\n // Has the instance been destroyed?\n isDestroyed: false,\n // Is the tippy currently mounted to the DOM?\n isMounted: false,\n // Has the tippy finished transitioning in?\n isShown: false,\n };\n\n const instance: Instance = {\n // properties\n id,\n reference,\n popper: div(),\n popperInstance,\n props,\n state,\n plugins,\n // methods\n clearDelayTimeouts,\n setProps,\n setContent,\n show,\n hide,\n hideWithInteractivity,\n enable,\n disable,\n unmount,\n destroy,\n };\n\n // TODO: Investigate why this early return causes a TDZ error in the tests —\n // it doesn't seem to happen in the browser\n /* istanbul ignore if */\n if (!props.render) {\n if (__DEV__) {\n errorWhen(true, 'render() function has not been supplied.');\n }\n\n return instance;\n }\n\n // ===========================================================================\n // Initial mutations\n // ===========================================================================\n const {popper, onUpdate} = props.render(instance);\n\n popper.setAttribute('data-__NAMESPACE_PREFIX__-root', '');\n popper.id = `__NAMESPACE_PREFIX__-${instance.id}`;\n\n instance.popper = popper;\n reference._tippy = instance;\n popper._tippy = instance;\n\n const pluginsHooks = plugins.map((plugin) => plugin.fn(instance));\n const hasAriaExpanded = reference.hasAttribute('aria-expanded');\n\n addListeners();\n handleAriaExpandedAttribute();\n handleStyles();\n\n invokeHook('onCreate', [instance]);\n\n if (props.showOnCreate) {\n scheduleShow();\n }\n\n // Prevent a tippy with a delay from hiding if the cursor left then returned\n // before it started hiding\n popper.addEventListener('mouseenter', () => {\n if (instance.props.interactive && instance.state.isVisible) {\n instance.clearDelayTimeouts();\n }\n });\n\n popper.addEventListener('mouseleave', () => {\n if (\n instance.props.interactive &&\n instance.props.trigger.indexOf('mouseenter') >= 0\n ) {\n getDocument().addEventListener('mousemove', debouncedOnMouseMove);\n }\n });\n\n return instance;\n\n // ===========================================================================\n // 🔒 Private methods\n // ===========================================================================\n function getNormalizedTouchSettings(): [string | boolean, number] {\n const {touch} = instance.props;\n return Array.isArray(touch) ? touch : [touch, 0];\n }\n\n function getIsCustomTouchBehavior(): boolean {\n return getNormalizedTouchSettings()[0] === 'hold';\n }\n\n function getIsDefaultRenderFn(): boolean {\n // @ts-ignore\n return !!instance.props.render?.$$tippy;\n }\n\n function getCurrentTarget(): Element {\n return currentTarget || reference;\n }\n\n function getDocument(): Document {\n const parent = getCurrentTarget().parentNode as Element;\n return parent ? getOwnerDocument(parent) : document;\n }\n\n function getDefaultTemplateChildren(): PopperChildren {\n return getChildren(popper);\n }\n\n function getDelay(isShow: boolean): number {\n // For touch or keyboard input, force `0` delay for UX reasons\n // Also if the instance is mounted but not visible (transitioning out),\n // ignore delay\n if (\n (instance.state.isMounted && !instance.state.isVisible) ||\n currentInput.isTouch ||\n (lastTriggerEvent && lastTriggerEvent.type === 'focus')\n ) {\n return 0;\n }\n\n return getValueAtIndexOrReturn(\n instance.props.delay,\n isShow ? 0 : 1,\n defaultProps.delay\n );\n }\n\n function handleStyles(fromHide = false): void {\n popper.style.pointerEvents =\n instance.props.interactive && !fromHide ? '' : 'none';\n popper.style.zIndex = `${instance.props.zIndex}`;\n }\n\n function invokeHook(\n hook: keyof LifecycleHooks,\n args: [Instance, any?],\n shouldInvokePropsHook = true\n ): void {\n pluginsHooks.forEach((pluginHooks) => {\n if (pluginHooks[hook]) {\n pluginHooks[hook]!(...args);\n }\n });\n\n if (shouldInvokePropsHook) {\n instance.props[hook](...args);\n }\n }\n\n function handleAriaContentAttribute(): void {\n const {aria} = instance.props;\n\n if (!aria.content) {\n return;\n }\n\n const attr = `aria-${aria.content}`;\n const id = popper.id;\n const nodes = normalizeToArray(instance.props.triggerTarget || reference);\n\n nodes.forEach((node) => {\n const currentValue = node.getAttribute(attr);\n\n if (instance.state.isVisible) {\n node.setAttribute(attr, currentValue ? `${currentValue} ${id}` : id);\n } else {\n const nextValue = currentValue && currentValue.replace(id, '').trim();\n\n if (nextValue) {\n node.setAttribute(attr, nextValue);\n } else {\n node.removeAttribute(attr);\n }\n }\n });\n }\n\n function handleAriaExpandedAttribute(): void {\n if (hasAriaExpanded || !instance.props.aria.expanded) {\n return;\n }\n\n const nodes = normalizeToArray(instance.props.triggerTarget || reference);\n\n nodes.forEach((node) => {\n if (instance.props.interactive) {\n node.setAttribute(\n 'aria-expanded',\n instance.state.isVisible && node === getCurrentTarget()\n ? 'true'\n : 'false'\n );\n } else {\n node.removeAttribute('aria-expanded');\n }\n });\n }\n\n function cleanupInteractiveMouseListeners(): void {\n getDocument().removeEventListener('mousemove', debouncedOnMouseMove);\n mouseMoveListeners = mouseMoveListeners.filter(\n (listener) => listener !== debouncedOnMouseMove\n );\n }\n\n function onDocumentPress(event: MouseEvent | TouchEvent): void {\n // Moved finger to scroll instead of an intentional tap outside\n if (currentInput.isTouch) {\n if (didTouchMove || event.type === 'mousedown') {\n return;\n }\n }\n\n const actualTarget =\n (event.composedPath && event.composedPath()[0]) || event.target;\n\n // Clicked on interactive popper\n if (\n instance.props.interactive &&\n actualContains(popper, actualTarget as Element)\n ) {\n return;\n }\n\n // Clicked on the event listeners target\n if (\n normalizeToArray(instance.props.triggerTarget || reference).some((el) =>\n actualContains(el, actualTarget as Element)\n )\n ) {\n if (currentInput.isTouch) {\n return;\n }\n\n if (\n instance.state.isVisible &&\n instance.props.trigger.indexOf('click') >= 0\n ) {\n return;\n }\n } else {\n invokeHook('onClickOutside', [instance, event]);\n }\n\n if (instance.props.hideOnClick === true) {\n instance.clearDelayTimeouts();\n instance.hide();\n\n // `mousedown` event is fired right before `focus` if pressing the\n // currentTarget. This lets a tippy with `focus` trigger know that it\n // should not show\n didHideDueToDocumentMouseDown = true;\n setTimeout(() => {\n didHideDueToDocumentMouseDown = false;\n });\n\n // The listener gets added in `scheduleShow()`, but this may be hiding it\n // before it shows, and hide()'s early bail-out behavior can prevent it\n // from being cleaned up\n if (!instance.state.isMounted) {\n removeDocumentPress();\n }\n }\n }\n\n function onTouchMove(): void {\n didTouchMove = true;\n }\n\n function onTouchStart(): void {\n didTouchMove = false;\n }\n\n function addDocumentPress(): void {\n const doc = getDocument();\n doc.addEventListener('mousedown', onDocumentPress, true);\n doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);\n doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);\n doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);\n }\n\n function removeDocumentPress(): void {\n const doc = getDocument();\n doc.removeEventListener('mousedown', onDocumentPress, true);\n doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);\n doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);\n doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);\n }\n\n function onTransitionedOut(duration: number, callback: () => void): void {\n onTransitionEnd(duration, () => {\n if (\n !instance.state.isVisible &&\n popper.parentNode &&\n popper.parentNode.contains(popper)\n ) {\n callback();\n }\n });\n }\n\n function onTransitionedIn(duration: number, callback: () => void): void {\n onTransitionEnd(duration, callback);\n }\n\n function onTransitionEnd(duration: number, callback: () => void): void {\n const box = getDefaultTemplateChildren().box;\n\n function listener(event: TransitionEvent): void {\n if (event.target === box) {\n updateTransitionEndListener(box, 'remove', listener);\n callback();\n }\n }\n\n // Make callback synchronous if duration is 0\n // `transitionend` won't fire otherwise\n if (duration === 0) {\n return callback();\n }\n\n updateTransitionEndListener(box, 'remove', currentTransitionEndListener);\n updateTransitionEndListener(box, 'add', listener);\n\n currentTransitionEndListener = listener;\n }\n\n function on(\n eventType: string,\n handler: EventListener,\n options: boolean | Record<string, unknown> = false\n ): void {\n const nodes = normalizeToArray(instance.props.triggerTarget || reference);\n nodes.forEach((node) => {\n node.addEventListener(eventType, handler, options);\n listeners.push({node, eventType, handler, options});\n });\n }\n\n function addListeners(): void {\n if (getIsCustomTouchBehavior()) {\n on('touchstart', onTrigger, {passive: true});\n on('touchend', onMouseLeave as EventListener, {passive: true});\n }\n\n splitBySpaces(instance.props.trigger).forEach((eventType) => {\n if (eventType === 'manual') {\n return;\n }\n\n on(eventType, onTrigger);\n\n switch (eventType) {\n case 'mouseenter':\n on('mouseleave', onMouseLeave as EventListener);\n break;\n case 'focus':\n on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut as EventListener);\n break;\n case 'focusin':\n on('focusout', onBlurOrFocusOut as EventListener);\n break;\n }\n });\n }\n\n function removeListeners(): void {\n listeners.forEach(({node, eventType, handler, options}: ListenerObject) => {\n node.removeEventListener(eventType, handler, options);\n });\n listeners = [];\n }\n\n function onTrigger(event: Event): void {\n let shouldScheduleClickHide = false;\n\n if (\n !instance.state.isEnabled ||\n isEventListenerStopped(event) ||\n didHideDueToDocumentMouseDown\n ) {\n return;\n }\n\n const wasFocused = lastTriggerEvent?.type === 'focus';\n\n lastTriggerEvent = event;\n currentTarget = event.currentTarget as Element;\n\n handleAriaExpandedAttribute();\n\n if (!instance.state.isVisible && isMouseEvent(event)) {\n // If scrolling, `mouseenter` events can be fired if the cursor lands\n // over a new target, but `mousemove` events don't get fired. This\n // causes interactive tooltips to get stuck open until the cursor is\n // moved\n mouseMoveListeners.forEach((listener) => listener(event));\n }\n\n // Toggle show/hide when clicking click-triggered tooltips\n if (\n event.type === 'click' &&\n (instance.props.trigger.indexOf('mouseenter') < 0 ||\n isVisibleFromClick) &&\n instance.props.hideOnClick !== false &&\n instance.state.isVisible\n ) {\n shouldScheduleClickHide = true;\n } else {\n scheduleShow(event);\n }\n\n if (event.type === 'click') {\n isVisibleFromClick = !shouldScheduleClickHide;\n }\n\n if (shouldScheduleClickHide && !wasFocused) {\n scheduleHide(event);\n }\n }\n\n function onMouseMove(event: MouseEvent): void {\n const target = event.target as Node;\n const isCursorOverReferenceOrPopper =\n getCurrentTarget().contains(target) || popper.contains(target);\n\n if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {\n return;\n }\n\n const popperTreeData = getNestedPopperTree()\n .concat(popper)\n .map((popper) => {\n const instance = popper._tippy!;\n const state = instance.popperInstance?.state;\n\n if (state) {\n return {\n popperRect: popper.getBoundingClientRect(),\n popperState: state,\n props,\n };\n }\n\n return null;\n })\n .filter(Boolean) as PopperTreeData[];\n\n if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {\n cleanupInteractiveMouseListeners();\n scheduleHide(event);\n }\n }\n\n function onMouseLeave(event: MouseEvent): void {\n const shouldBail =\n isEventListenerStopped(event) ||\n (instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick);\n\n if (shouldBail) {\n return;\n }\n\n if (instance.props.interactive) {\n instance.hideWithInteractivity(event);\n return;\n }\n\n scheduleHide(event);\n }\n\n function onBlurOrFocusOut(event: FocusEvent): void {\n if (\n instance.props.trigger.indexOf('focusin') < 0 &&\n event.target !== getCurrentTarget()\n ) {\n return;\n }\n\n // If focus was moved to within the popper\n if (\n instance.props.interactive &&\n event.relatedTarget &&\n popper.contains(event.relatedTarget as Element)\n ) {\n return;\n }\n\n scheduleHide(event);\n }\n\n function isEventListenerStopped(event: Event): boolean {\n return currentInput.isTouch\n ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0\n : false;\n }\n\n function createPopperInstance(): void {\n destroyPopperInstance();\n\n const {\n popperOptions,\n placement,\n offset,\n getReferenceClientRect,\n moveTransition,\n } = instance.props;\n\n const arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null;\n\n const computedReference = getReferenceClientRect\n ? {\n getBoundingClientRect: getReferenceClientRect,\n contextElement:\n getReferenceClientRect.contextElement || getCurrentTarget(),\n }\n : reference;\n\n const tippyModifier: Modifier<'$$tippy', Record<string, unknown>> = {\n name: '$$tippy',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn({state}) {\n if (getIsDefaultRenderFn()) {\n const {box} = getDefaultTemplateChildren();\n\n ['placement', 'reference-hidden', 'escaped'].forEach((attr) => {\n if (attr === 'placement') {\n box.setAttribute('data-placement', state.placement);\n } else {\n if (state.attributes.popper[`data-popper-${attr}`]) {\n box.setAttribute(`data-${attr}`, '');\n } else {\n box.removeAttribute(`data-${attr}`);\n }\n }\n });\n\n state.attributes.popper = {};\n }\n },\n };\n\n type TippyModifier = Modifier<'$$tippy', Record<string, unknown>>;\n type ExtendedModifiers = StrictModifiers | Partial<TippyModifier>;\n\n const modifiers: Array<ExtendedModifiers> = [\n {\n name: 'offset',\n options: {\n offset,\n },\n },\n {\n name: 'preventOverflow',\n options: {\n padding: {\n top: 2,\n bottom: 2,\n left: 5,\n right: 5,\n },\n },\n },\n {\n name: 'flip',\n options: {\n padding: 5,\n },\n },\n {\n name: 'computeStyles',\n options: {\n adaptive: !moveTransition,\n },\n },\n tippyModifier,\n ];\n\n if (getIsDefaultRenderFn() && arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrow,\n padding: 3,\n },\n });\n }\n\n modifiers.push(...(popperOptions?.modifiers || []));\n\n instance.popperInstance = createPopper<ExtendedModifiers>(\n computedReference,\n popper,\n {\n ...popperOptions,\n placement,\n onFirstUpdate,\n modifiers,\n }\n );\n }\n\n function destroyPopperInstance(): void {\n if (instance.popperInstance) {\n instance.popperInstance.destroy();\n instance.popperInstance = null;\n }\n }\n\n function mount(): void {\n const {appendTo} = instance.props;\n\n let parentNode: any;\n\n // By default, we'll append the popper to the triggerTargets's parentNode so\n // it's directly after the reference element so the elements inside the\n // tippy can be tabbed to\n // If there are clipping issues, the user can specify a different appendTo\n // and ensure focus management is handled correctly manually\n const node = getCurrentTarget();\n\n if (\n (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO) ||\n appendTo === 'parent'\n ) {\n parentNode = node.parentNode;\n } else {\n parentNode = invokeWithArgsOrReturn(appendTo, [node]);\n }\n\n // The popper element needs to exist on the DOM before its position can be\n // updated as Popper needs to read its dimensions\n if (!parentNode.contains(popper)) {\n parentNode.appendChild(popper);\n }\n\n instance.state.isMounted = true;\n\n createPopperInstance();\n\n /* istanbul ignore else */\n if (__DEV__) {\n // Accessibility check\n warnWhen(\n instance.props.interactive &&\n appendTo === defaultProps.appendTo &&\n node.nextElementSibling !== popper,\n [\n 'Interactive tippy element may not be accessible via keyboard',\n 'navigation because it is not directly after the reference element',\n 'in the DOM source order.',\n '\\n\\n',\n 'Using a wrapper <div> or <span> tag around the reference element',\n 'solves this by creating a new parentNode context.',\n '\\n\\n',\n 'Specifying `appendTo: document.body` silences this warning, but it',\n 'assumes you are using a focus management solution to handle',\n 'keyboard navigation.',\n '\\n\\n',\n 'See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity',\n ].join(' ')\n );\n }\n }\n\n function getNestedPopperTree(): PopperElement[] {\n return arrayFrom(\n popper.querySelectorAll('[data-__NAMESPACE_PREFIX__-root]')\n );\n }\n\n function scheduleShow(event?: Event): void {\n instance.clearDelayTimeouts();\n\n if (event) {\n invokeHook('onTrigger', [instance, event]);\n }\n\n addDocumentPress();\n\n let delay = getDelay(true);\n const [touchValue, touchDelay] = getNormalizedTouchSettings();\n\n if (currentInput.isTouch && touchValue === 'hold' && touchDelay) {\n delay = touchDelay;\n }\n\n if (delay) {\n showTimeout = setTimeout(() => {\n instance.show();\n }, delay);\n } else {\n instance.show();\n }\n }\n\n function scheduleHide(event: Event): void {\n instance.clearDelayTimeouts();\n\n invokeHook('onUntrigger', [instance, event]);\n\n if (!instance.state.isVisible) {\n removeDocumentPress();\n\n return;\n }\n\n // For interactive tippies, scheduleHide is added to a document.body handler\n // from onMouseLeave so must intercept scheduled hides from mousemove/leave\n // events when trigger contains mouseenter and click, and the tip is\n // currently shown as a result of a click.\n if (\n instance.props.trigger.indexOf('mouseenter') >= 0 &&\n instance.props.trigger.indexOf('click') >= 0 &&\n ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 &&\n isVisibleFromClick\n ) {\n return;\n }\n\n const delay = getDelay(false);\n\n if (delay) {\n hideTimeout = setTimeout(() => {\n if (instance.state.isVisible) {\n instance.hide();\n }\n }, delay);\n } else {\n // Fixes a `transitionend` problem when it fires 1 frame too\n // late sometimes, we don't want hide() to be called.\n scheduleHideAnimationFrame = requestAnimationFrame(() => {\n instance.hide();\n });\n }\n }\n\n // ===========================================================================\n // 🔑 Public methods\n // ===========================================================================\n function enable(): void {\n instance.state.isEnabled = true;\n }\n\n function disable(): void {\n // Disabling the instance should also hide it\n // https://github.com/atomiks/tippy.js-react/issues/106\n instance.hide();\n instance.state.isEnabled = false;\n }\n\n function clearDelayTimeouts(): void {\n clearTimeout(showTimeout);\n clearTimeout(hideTimeout);\n cancelAnimationFrame(scheduleHideAnimationFrame);\n }\n\n function setProps(partialProps: Partial<Props>): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));\n }\n\n if (instance.state.isDestroyed) {\n return;\n }\n\n invokeHook('onBeforeUpdate', [instance, partialProps]);\n\n removeListeners();\n\n const prevProps = instance.props;\n const nextProps = evaluateProps(reference, {\n ...prevProps,\n ...removeUndefinedProps(partialProps),\n ignoreAttributes: true,\n });\n\n instance.props = nextProps;\n\n addListeners();\n\n if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {\n cleanupInteractiveMouseListeners();\n debouncedOnMouseMove = debounce(\n onMouseMove,\n nextProps.interactiveDebounce\n );\n }\n\n // Ensure stale aria-expanded attributes are removed\n if (prevProps.triggerTarget && !nextProps.triggerTarget) {\n normalizeToArray(prevProps.triggerTarget).forEach((node) => {\n node.removeAttribute('aria-expanded');\n });\n } else if (nextProps.triggerTarget) {\n reference.removeAttribute('aria-expanded');\n }\n\n handleAriaExpandedAttribute();\n handleStyles();\n\n if (onUpdate) {\n onUpdate(prevProps, nextProps);\n }\n\n if (instance.popperInstance) {\n createPopperInstance();\n\n // Fixes an issue with nested tippies if they are all getting re-rendered,\n // and the nested ones get re-rendered first.\n // https://github.com/atomiks/tippyjs-react/issues/177\n // TODO: find a cleaner / more efficient solution(!)\n getNestedPopperTree().forEach((nestedPopper) => {\n // React (and other UI libs likely) requires a rAF wrapper as it flushes\n // its work in one\n requestAnimationFrame(nestedPopper._tippy!.popperInstance!.forceUpdate);\n });\n }\n\n invokeHook('onAfterUpdate', [instance, partialProps]);\n }\n\n function setContent(content: Content): void {\n instance.setProps({content});\n }\n\n function show(): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));\n }\n\n // Early bail-out\n const isAlreadyVisible = instance.state.isVisible;\n const isDestroyed = instance.state.isDestroyed;\n const isDisabled = !instance.state.isEnabled;\n const isTouchAndTouchDisabled =\n currentInput.isTouch && !instance.props.touch;\n const duration = getValueAtIndexOrReturn(\n instance.props.duration,\n 0,\n defaultProps.duration\n );\n\n if (\n isAlreadyVisible ||\n isDestroyed ||\n isDisabled ||\n isTouchAndTouchDisabled\n ) {\n return;\n }\n\n // Normalize `disabled` behavior across browsers.\n // Firefox allows events on disabled elements, but Chrome doesn't.\n // Using a wrapper element (i.e. <span>) is recommended.\n if (getCurrentTarget().hasAttribute('disabled')) {\n return;\n }\n\n invokeHook('onShow', [instance], false);\n if (instance.props.onShow(instance) === false) {\n return;\n }\n\n instance.state.isVisible = true;\n\n if (getIsDefaultRenderFn()) {\n popper.style.visibility = 'visible';\n }\n\n handleStyles();\n addDocumentPress();\n\n if (!instance.state.isMounted) {\n popper.style.transition = 'none';\n }\n\n // If flipping to the opposite side after hiding at least once, the\n // animation will use the wrong placement without resetting the duration\n if (getIsDefaultRenderFn()) {\n const {box, content} = getDefaultTemplateChildren();\n setTransitionDuration([box, content], 0);\n }\n\n onFirstUpdate = (): void => {\n if (!instance.state.isVisible || ignoreOnFirstUpdate) {\n return;\n }\n\n ignoreOnFirstUpdate = true;\n\n // reflow\n void popper.offsetHeight;\n\n popper.style.transition = instance.props.moveTransition;\n\n if (getIsDefaultRenderFn() && instance.props.animation) {\n const {box, content} = getDefaultTemplateChildren();\n setTransitionDuration([box, content], duration);\n setVisibilityState([box, content], 'visible');\n }\n\n handleAriaContentAttribute();\n handleAriaExpandedAttribute();\n\n pushIfUnique(mountedInstances, instance);\n\n // certain modifiers (e.g. `maxSize`) require a second update after the\n // popper has been positioned for the first time\n instance.popperInstance?.forceUpdate();\n\n invokeHook('onMount', [instance]);\n\n if (instance.props.animation && getIsDefaultRenderFn()) {\n onTransitionedIn(duration, () => {\n instance.state.isShown = true;\n invokeHook('onShown', [instance]);\n });\n }\n };\n\n mount();\n }\n\n function hide(): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));\n }\n\n // Early bail-out\n const isAlreadyHidden = !instance.state.isVisible;\n const isDestroyed = instance.state.isDestroyed;\n const isDisabled = !instance.state.isEnabled;\n const duration = getValueAtIndexOrReturn(\n instance.props.duration,\n 1,\n defaultProps.duration\n );\n\n if (isAlreadyHidden || isDestroyed || isDisabled) {\n return;\n }\n\n invokeHook('onHide', [instance], false);\n if (instance.props.onHide(instance) === false) {\n return;\n }\n\n instance.state.isVisible = false;\n instance.state.isShown = false;\n ignoreOnFirstUpdate = false;\n isVisibleFromClick = false;\n\n if (getIsDefaultRenderFn()) {\n popper.style.visibility = 'hidden';\n }\n\n cleanupInteractiveMouseListeners();\n removeDocumentPress();\n handleStyles(true);\n\n if (getIsDefaultRenderFn()) {\n const {box, content} = getDefaultTemplateChildren();\n\n if (instance.props.animation) {\n setTransitionDuration([box, content], duration);\n setVisibilityState([box, content], 'hidden');\n }\n }\n\n handleAriaContentAttribute();\n handleAriaExpandedAttribute();\n\n if (instance.props.animation) {\n if (getIsDefaultRenderFn()) {\n onTransitionedOut(duration, instance.unmount);\n }\n } else {\n instance.unmount();\n }\n }\n\n function hideWithInteractivity(event: MouseEvent): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(\n instance.state.isDestroyed,\n createMemoryLeakWarning('hideWithInteractivity')\n );\n }\n\n getDocument().addEventListener('mousemove', debouncedOnMouseMove);\n pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);\n debouncedOnMouseMove(event);\n }\n\n function unmount(): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));\n }\n\n if (instance.state.isVisible) {\n instance.hide();\n }\n\n if (!instance.state.isMounted) {\n return;\n }\n\n destroyPopperInstance();\n\n // If a popper is not interactive, it will be appended outside the popper\n // tree by default. This seems mainly for interactive tippies, but we should\n // find a workaround if possible\n getNestedPopperTree().forEach((nestedPopper) => {\n nestedPopper._tippy!.unmount();\n });\n\n if (popper.parentNode) {\n popper.parentNode.removeChild(popper);\n }\n\n mountedInstances = mountedInstances.filter((i) => i !== instance);\n\n instance.state.isMounted = false;\n invokeHook('onHidden', [instance]);\n }\n\n function destroy(): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));\n }\n\n if (instance.state.isDestroyed) {\n return;\n }\n\n instance.clearDelayTimeouts();\n instance.unmount();\n\n removeListeners();\n\n delete reference._tippy;\n\n instance.state.isDestroyed = true;\n\n invokeHook('onDestroy', [instance]);\n }\n}\n", "import bindGlobalEventListeners, {\n currentInput,\n} from './bindGlobalEventListeners';\nimport createTippy, {mountedInstances} from './createTippy';\nimport {getArrayOfElements, isElement, isReferenceElement} from './dom-utils';\nimport {defaultProps, setDefaultProps, validateProps} from './props';\nimport {HideAll, HideAllOptions, Instance, Props, Targets} from './types';\nimport {validateTargets, warnWhen} from './validation';\n\nfunction tippy(\n targets: Targets,\n optionalProps: Partial<Props> = {}\n): Instance | Instance[] {\n const plugins = defaultProps.plugins.concat(optionalProps.plugins || []);\n\n /* istanbul ignore else */\n if (__DEV__) {\n validateTargets(targets);\n validateProps(optionalProps, plugins);\n }\n\n bindGlobalEventListeners();\n\n const passedProps: Partial<Props> = {...optionalProps, plugins};\n\n const elements = getArrayOfElements(targets);\n\n /* istanbul ignore else */\n if (__DEV__) {\n const isSingleContentElement = isElement(passedProps.content);\n const isMoreThanOneReferenceElement = elements.length > 1;\n warnWhen(\n isSingleContentElement && isMoreThanOneReferenceElement,\n [\n 'tippy() was passed an Element as the `content` prop, but more than',\n 'one tippy instance was created by this invocation. This means the',\n 'content element will only be appended to the last tippy instance.',\n '\\n\\n',\n 'Instead, pass the .innerHTML of the element, or use a function that',\n 'returns a cloned version of the element instead.',\n '\\n\\n',\n '1) content: element.innerHTML\\n',\n '2) content: () => element.cloneNode(true)',\n ].join(' ')\n );\n }\n\n const instances = elements.reduce<Instance[]>(\n (acc, reference): Instance[] => {\n const instance = reference && createTippy(reference, passedProps);\n\n if (instance) {\n acc.push(instance);\n }\n\n return acc;\n },\n []\n );\n\n return isElement(targets) ? instances[0] : instances;\n}\n\ntippy.defaultProps = defaultProps;\ntippy.setDefaultProps = setDefaultProps;\ntippy.currentInput = currentInput;\n\nexport default tippy;\n\nexport const hideAll: HideAll = ({\n exclude: excludedReferenceOrInstance,\n duration,\n}: HideAllOptions = {}) => {\n mountedInstances.forEach((instance) => {\n let isExcluded = false;\n\n if (excludedReferenceOrInstance) {\n isExcluded = isReferenceElement(excludedReferenceOrInstance)\n ? instance.reference === excludedReferenceOrInstance\n : instance.popper === (excludedReferenceOrInstance as Instance).popper;\n }\n\n if (!isExcluded) {\n const originalDuration = instance.props.duration;\n\n instance.setProps({duration});\n instance.hide();\n\n if (!instance.state.isDestroyed) {\n instance.setProps({duration: originalDuration});\n }\n }\n });\n};\n", "import tippy from '..';\nimport {div} from '../dom-utils';\nimport {\n CreateSingleton,\n Plugin,\n CreateSingletonProps,\n ReferenceElement,\n CreateSingletonInstance,\n Instance,\n Props,\n} from '../types';\nimport {normalizeToArray, removeProperties} from '../utils';\nimport {errorWhen} from '../validation';\nimport {applyStyles, Modifier} from '@popperjs/core';\n\n// The default `applyStyles` modifier has a cleanup function that gets called\n// every time the popper is destroyed (i.e. a new target), removing the styles\n// and causing transitions to break for singletons when the console is open, but\n// most notably for non-transform styles being used, `gpuAcceleration: false`.\nconst applyStylesModifier: Modifier<'applyStyles', Record<string, unknown>> = {\n ...applyStyles,\n effect({state}) {\n const initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0',\n },\n arrow: {\n position: 'absolute',\n },\n reference: {},\n };\n\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n // intentionally return no cleanup function\n // return () => { ... }\n },\n};\n\nconst createSingleton: CreateSingleton = (\n tippyInstances,\n optionalProps = {}\n) => {\n /* istanbul ignore else */\n if (__DEV__) {\n errorWhen(\n !Array.isArray(tippyInstances),\n [\n 'The first argument passed to createSingleton() must be an array of',\n 'tippy instances. The passed value was',\n String(tippyInstances),\n ].join(' ')\n );\n }\n\n let individualInstances = tippyInstances;\n let references: Array<ReferenceElement> = [];\n let triggerTargets: Array<Element> = [];\n let currentTarget: Element | null;\n let overrides = optionalProps.overrides;\n let interceptSetPropsCleanups: Array<() => void> = [];\n let shownOnCreate = false;\n\n function setTriggerTargets(): void {\n triggerTargets = individualInstances\n .map((instance) =>\n normalizeToArray(instance.props.triggerTarget || instance.reference)\n )\n .reduce((acc, item) => acc.concat(item), []);\n }\n\n function setReferences(): void {\n references = individualInstances.map((instance) => instance.reference);\n }\n\n function enableInstances(isEnabled: boolean): void {\n individualInstances.forEach((instance) => {\n if (isEnabled) {\n instance.enable();\n } else {\n instance.disable();\n }\n });\n }\n\n function interceptSetProps(singleton: Instance): Array<() => void> {\n return individualInstances.map((instance) => {\n const originalSetProps = instance.setProps;\n\n instance.setProps = (props): void => {\n originalSetProps(props);\n\n if (instance.reference === currentTarget) {\n singleton.setProps(props);\n }\n };\n\n return (): void => {\n instance.setProps = originalSetProps;\n };\n });\n }\n\n // have to pass singleton, as it maybe undefined on first call\n function prepareInstance(\n singleton: Instance,\n target: ReferenceElement\n ): void {\n const index = triggerTargets.indexOf(target);\n\n // bail-out\n if (target === currentTarget) {\n return;\n }\n\n currentTarget = target;\n\n const overrideProps: Partial<Props> = (overrides || [])\n .concat('content')\n .reduce((acc, prop) => {\n (acc as any)[prop] = individualInstances[index].props[prop];\n return acc;\n }, {});\n\n singleton.setProps({\n ...overrideProps,\n getReferenceClientRect:\n typeof overrideProps.getReferenceClientRect === 'function'\n ? overrideProps.getReferenceClientRect\n : (): ClientRect => references[index]?.getBoundingClientRect(),\n });\n }\n\n enableInstances(false);\n setReferences();\n setTriggerTargets();\n\n const plugin: Plugin = {\n fn() {\n return {\n onDestroy(): void {\n enableInstances(true);\n },\n onHidden(): void {\n currentTarget = null;\n },\n onClickOutside(instance): void {\n if (instance.props.showOnCreate && !shownOnCreate) {\n shownOnCreate = true;\n currentTarget = null;\n }\n },\n onShow(instance): void {\n if (instance.props.showOnCreate && !shownOnCreate) {\n shownOnCreate = true;\n prepareInstance(instance, references[0]);\n }\n },\n onTrigger(instance, event): void {\n prepareInstance(instance, event.currentTarget as Element);\n },\n };\n },\n };\n\n const singleton = tippy(div(), {\n ...removeProperties(optionalProps, ['overrides']),\n plugins: [plugin, ...(optionalProps.plugins || [])],\n triggerTarget: triggerTargets,\n popperOptions: {\n ...optionalProps.popperOptions,\n modifiers: [\n ...(optionalProps.popperOptions?.modifiers || []),\n applyStylesModifier,\n ],\n },\n }) as CreateSingletonInstance<CreateSingletonProps>;\n\n const originalShow = singleton.show;\n\n singleton.show = (target?: ReferenceElement | Instance | number): void => {\n originalShow();\n\n // first time, showOnCreate or programmatic call with no params\n // default to showing first instance\n if (!currentTarget && target == null) {\n return prepareInstance(singleton, references[0]);\n }\n\n // triggered from event (do nothing as prepareInstance already called by onTrigger)\n // programmatic call with no params when already visible (do nothing again)\n if (currentTarget && target == null) {\n return;\n }\n\n // target is index of instance\n if (typeof target === 'number') {\n return (\n references[target] && prepareInstance(singleton, references[target])\n );\n }\n\n // target is a child tippy instance\n if (individualInstances.indexOf(target as Instance) >= 0) {\n const ref = (target as Instance).reference;\n return prepareInstance(singleton, ref);\n }\n\n // target is a ReferenceElement\n if (references.indexOf(target as ReferenceElement) >= 0) {\n return prepareInstance(singleton, target as ReferenceElement);\n }\n };\n\n singleton.showNext = (): void => {\n const first = references[0];\n if (!currentTarget) {\n return singleton.show(0);\n }\n const index = references.indexOf(currentTarget);\n singleton.show(references[index + 1] || first);\n };\n\n singleton.showPrevious = (): void => {\n const last = references[references.length - 1];\n if (!currentTarget) {\n return singleton.show(last);\n }\n const index = references.indexOf(currentTarget);\n const target = references[index - 1] || last;\n singleton.show(target);\n };\n\n const originalSetProps = singleton.setProps;\n\n singleton.setProps = (props): void => {\n overrides = props.overrides || overrides;\n originalSetProps(props);\n };\n\n singleton.setInstances = (nextInstances): void => {\n enableInstances(true);\n interceptSetPropsCleanups.forEach((fn) => fn());\n\n individualInstances = nextInstances;\n\n enableInstances(false);\n setReferences();\n setTriggerTargets();\n interceptSetPropsCleanups = interceptSetProps(singleton);\n\n singleton.setProps({triggerTarget: triggerTargets});\n };\n\n interceptSetPropsCleanups = interceptSetProps(singleton);\n\n return singleton;\n};\n\nexport default createSingleton;\n", "import tippy from '..';\nimport {TOUCH_OPTIONS} from '../constants';\nimport {defaultProps} from '../props';\nimport {Instance, Props, Targets} from '../types';\nimport {ListenerObject} from '../types-internal';\nimport {normalizeToArray, removeProperties} from '../utils';\nimport {errorWhen} from '../validation';\n\nconst BUBBLING_EVENTS_MAP = {\n mouseover: 'mouseenter',\n focusin: 'focus',\n click: 'click',\n};\n\n/**\n * Creates a delegate instance that controls the creation of tippy instances\n * for child elements (`target` CSS selector).\n */\nfunction delegate(\n targets: Targets,\n props: Partial<Props> & {target: string}\n): Instance | Instance[] {\n /* istanbul ignore else */\n if (__DEV__) {\n errorWhen(\n !(props && props.target),\n [\n 'You must specity a `target` prop indicating a CSS selector string matching',\n 'the target elements that should receive a tippy.',\n ].join(' ')\n );\n }\n\n let listeners: ListenerObject[] = [];\n let childTippyInstances: Instance[] = [];\n let disabled = false;\n\n const {target} = props;\n\n const nativeProps = removeProperties(props, ['target']);\n const parentProps = {...nativeProps, trigger: 'manual', touch: false};\n const childProps = {\n touch: defaultProps.touch,\n ...nativeProps,\n showOnCreate: true,\n };\n\n const returnValue = tippy(targets, parentProps);\n const normalizedReturnValue = normalizeToArray(returnValue);\n\n function onTrigger(event: Event): void {\n if (!event.target || disabled) {\n return;\n }\n\n const targetNode = (event.target as Element).closest(target);\n\n if (!targetNode) {\n return;\n }\n\n // Get relevant trigger with fallbacks:\n // 1. Check `data-tippy-trigger` attribute on target node\n // 2. Fallback to `trigger` passed to `delegate()`\n // 3. Fallback to `defaultProps.trigger`\n const trigger =\n targetNode.getAttribute('data-tippy-trigger') ||\n props.trigger ||\n defaultProps.trigger;\n\n // @ts-ignore\n if (targetNode._tippy) {\n return;\n }\n\n if (event.type === 'touchstart' && typeof childProps.touch === 'boolean') {\n return;\n }\n\n if (\n event.type !== 'touchstart' &&\n trigger.indexOf((BUBBLING_EVENTS_MAP as any)[event.type]) < 0\n ) {\n return;\n }\n\n const instance = tippy(targetNode, childProps);\n\n if (instance) {\n childTippyInstances = childTippyInstances.concat(instance);\n }\n }\n\n function on(\n node: Element,\n eventType: string,\n handler: EventListener,\n options: boolean | Record<string, unknown> = false\n ): void {\n node.addEventListener(eventType, handler, options);\n listeners.push({node, eventType, handler, options});\n }\n\n function addEventListeners(instance: Instance): void {\n const {reference} = instance;\n\n on(reference, 'touchstart', onTrigger, TOUCH_OPTIONS);\n on(reference, 'mouseover', onTrigger);\n on(reference, 'focusin', onTrigger);\n on(reference, 'click', onTrigger);\n }\n\n function removeEventListeners(): void {\n listeners.forEach(({node, eventType, handler, options}: ListenerObject) => {\n node.removeEventListener(eventType, handler, options);\n });\n listeners = [];\n }\n\n function applyMutations(instance: Instance): void {\n const originalDestroy = instance.destroy;\n const originalEnable = instance.enable;\n const originalDisable = instance.disable;\n\n instance.destroy = (shouldDestroyChildInstances = true): void => {\n if (shouldDestroyChildInstances) {\n childTippyInstances.forEach((instance) => {\n instance.destroy();\n });\n }\n\n childTippyInstances = [];\n\n removeEventListeners();\n originalDestroy();\n };\n\n instance.enable = (): void => {\n originalEnable();\n childTippyInstances.forEach((instance) => instance.enable());\n disabled = false;\n };\n\n instance.disable = (): void => {\n originalDisable();\n childTippyInstances.forEach((instance) => instance.disable());\n disabled = true;\n };\n\n addEventListeners(instance);\n }\n\n normalizedReturnValue.forEach(applyMutations);\n\n return returnValue;\n}\n\nexport default delegate;\n", "import {BACKDROP_CLASS} from '../constants';\nimport {div, setVisibilityState} from '../dom-utils';\nimport {getChildren} from '../template';\nimport {AnimateFill} from '../types';\nimport {errorWhen} from '../validation';\n\nconst animateFill: AnimateFill = {\n name: 'animateFill',\n defaultValue: false,\n fn(instance) {\n // @ts-ignore\n if (!instance.props.render?.$$tippy) {\n if (__DEV__) {\n errorWhen(\n instance.props.animateFill,\n 'The `animateFill` plugin requires the default render function.'\n );\n }\n\n return {};\n }\n\n const {box, content} = getChildren(instance.popper);\n\n const backdrop = instance.props.animateFill\n ? createBackdropElement()\n : null;\n\n return {\n onCreate(): void {\n if (backdrop) {\n box.insertBefore(backdrop, box.firstElementChild!);\n box.setAttribute('data-animatefill', '');\n box.style.overflow = 'hidden';\n\n instance.setProps({arrow: false, animation: 'shift-away'});\n }\n },\n onMount(): void {\n if (backdrop) {\n const {transitionDuration} = box.style;\n const duration = Number(transitionDuration.replace('ms', ''));\n\n // The content should fade in after the backdrop has mostly filled the\n // tooltip element. `clip-path` is the other alternative but is not\n // well-supported and is buggy on some devices.\n content.style.transitionDelay = `${Math.round(duration / 10)}ms`;\n\n backdrop.style.transitionDuration = transitionDuration;\n setVisibilityState([backdrop], 'visible');\n }\n },\n onShow(): void {\n if (backdrop) {\n backdrop.style.transitionDuration = '0ms';\n }\n },\n onHide(): void {\n if (backdrop) {\n setVisibilityState([backdrop], 'hidden');\n }\n },\n };\n },\n};\n\nexport default animateFill;\n\nfunction createBackdropElement(): HTMLDivElement {\n const backdrop = div();\n backdrop.className = BACKDROP_CLASS;\n setVisibilityState([backdrop], 'hidden');\n return backdrop;\n}\n", "import {getOwnerDocument, isMouseEvent} from '../dom-utils';\nimport {FollowCursor, Instance} from '../types';\n\nlet mouseCoords = {clientX: 0, clientY: 0};\nlet activeInstances: Array<{instance: Instance; doc: Document}> = [];\n\nfunction storeMouseCoords({clientX, clientY}: MouseEvent): void {\n mouseCoords = {clientX, clientY};\n}\n\nfunction addMouseCoordsListener(doc: Document): void {\n doc.addEventListener('mousemove', storeMouseCoords);\n}\n\nfunction removeMouseCoordsListener(doc: Document): void {\n doc.removeEventListener('mousemove', storeMouseCoords);\n}\n\nconst followCursor: FollowCursor = {\n name: 'followCursor',\n defaultValue: false,\n fn(instance) {\n const reference = instance.reference;\n const doc = getOwnerDocument(instance.props.triggerTarget || reference);\n\n let isInternalUpdate = false;\n let wasFocusEvent = false;\n let isUnmounted = true;\n let prevProps = instance.props;\n\n function getIsInitialBehavior(): boolean {\n return (\n instance.props.followCursor === 'initial' && instance.state.isVisible\n );\n }\n\n function addListener(): void {\n doc.addEventListener('mousemove', onMouseMove);\n }\n\n function removeListener(): void {\n doc.removeEventListener('mousemove', onMouseMove);\n }\n\n function unsetGetReferenceClientRect(): void {\n isInternalUpdate = true;\n instance.setProps({getReferenceClientRect: null});\n isInternalUpdate = false;\n }\n\n function onMouseMove(event: MouseEvent): void {\n // If the instance is interactive, avoid updating the position unless it's\n // over the reference element\n const isCursorOverReference = event.target\n ? reference.contains(event.target as Node)\n : true;\n const {followCursor} = instance.props;\n const {clientX, clientY} = event;\n\n const rect = reference.getBoundingClientRect();\n const relativeX = clientX - rect.left;\n const relativeY = clientY - rect.top;\n\n if (isCursorOverReference || !instance.props.interactive) {\n instance.setProps({\n // @ts-ignore - unneeded DOMRect properties\n getReferenceClientRect() {\n const rect = reference.getBoundingClientRect();\n\n let x = clientX;\n let y = clientY;\n\n if (followCursor === 'initial') {\n x = rect.left + relativeX;\n y = rect.top + relativeY;\n }\n\n const top = followCursor === 'horizontal' ? rect.top : y;\n const right = followCursor === 'vertical' ? rect.right : x;\n const bottom = followCursor === 'horizontal' ? rect.bottom : y;\n const left = followCursor === 'vertical' ? rect.left : x;\n\n return {\n width: right - left,\n height: bottom - top,\n top,\n right,\n bottom,\n left,\n };\n },\n });\n }\n }\n\n function create(): void {\n if (instance.props.followCursor) {\n activeInstances.push({instance, doc});\n addMouseCoordsListener(doc);\n }\n }\n\n function destroy(): void {\n activeInstances = activeInstances.filter(\n (data) => data.instance !== instance\n );\n\n if (activeInstances.filter((data) => data.doc === doc).length === 0) {\n removeMouseCoordsListener(doc);\n }\n }\n\n return {\n onCreate: create,\n onDestroy: destroy,\n onBeforeUpdate(): void {\n prevProps = instance.props;\n },\n onAfterUpdate(_, {followCursor}): void {\n if (isInternalUpdate) {\n return;\n }\n\n if (\n followCursor !== undefined &&\n prevProps.followCursor !== followCursor\n ) {\n destroy();\n\n if (followCursor) {\n create();\n\n if (\n instance.state.isMounted &&\n !wasFocusEvent &&\n !getIsInitialBehavior()\n ) {\n addListener();\n }\n } else {\n removeListener();\n unsetGetReferenceClientRect();\n }\n }\n },\n onMount(): void {\n if (instance.props.followCursor && !wasFocusEvent) {\n if (isUnmounted) {\n onMouseMove(mouseCoords as MouseEvent);\n isUnmounted = false;\n }\n\n if (!getIsInitialBehavior()) {\n addListener();\n }\n }\n },\n onTrigger(_, event): void {\n if (isMouseEvent(event)) {\n mouseCoords = {clientX: event.clientX, clientY: event.clientY};\n }\n wasFocusEvent = event.type === 'focus';\n },\n onHidden(): void {\n if (instance.props.followCursor) {\n unsetGetReferenceClientRect();\n removeListener();\n isUnmounted = true;\n }\n },\n };\n },\n};\n\nexport default followCursor;\n", "import {Modifier, Placement} from '@popperjs/core';\nimport {isMouseEvent} from '../dom-utils';\nimport {BasePlacement, InlinePositioning, Props} from '../types';\nimport {arrayFrom, getBasePlacement} from '../utils';\n\nfunction getProps(props: Props, modifier: Modifier<any, any>): Partial<Props> {\n return {\n popperOptions: {\n ...props.popperOptions,\n modifiers: [\n ...(props.popperOptions?.modifiers || []).filter(\n ({name}) => name !== modifier.name\n ),\n modifier,\n ],\n },\n };\n}\n\nconst inlinePositioning: InlinePositioning = {\n name: 'inlinePositioning',\n defaultValue: false,\n fn(instance) {\n const {reference} = instance;\n\n function isEnabled(): boolean {\n return !!instance.props.inlinePositioning;\n }\n\n let placement: Placement;\n let cursorRectIndex = -1;\n let isInternalUpdate = false;\n let triedPlacements: Array<string> = [];\n\n const modifier: Modifier<\n 'tippyInlinePositioning',\n Record<string, unknown>\n > = {\n name: 'tippyInlinePositioning',\n enabled: true,\n phase: 'afterWrite',\n fn({state}) {\n if (isEnabled()) {\n if (triedPlacements.indexOf(state.placement) !== -1) {\n triedPlacements = [];\n }\n\n if (\n placement !== state.placement &&\n triedPlacements.indexOf(state.placement) === -1\n ) {\n triedPlacements.push(state.placement);\n instance.setProps({\n // @ts-ignore - unneeded DOMRect properties\n getReferenceClientRect: () =>\n getReferenceClientRect(state.placement),\n });\n }\n\n placement = state.placement;\n }\n },\n };\n\n function getReferenceClientRect(placement: Placement): Partial<DOMRect> {\n return getInlineBoundingClientRect(\n getBasePlacement(placement),\n reference.getBoundingClientRect(),\n arrayFrom(reference.getClientRects()),\n cursorRectIndex\n );\n }\n\n function setInternalProps(partialProps: Partial<Props>): void {\n isInternalUpdate = true;\n instance.setProps(partialProps);\n isInternalUpdate = false;\n }\n\n function addModifier(): void {\n if (!isInternalUpdate) {\n setInternalProps(getProps(instance.props, modifier));\n }\n }\n\n return {\n onCreate: addModifier,\n onAfterUpdate: addModifier,\n onTrigger(_, event): void {\n if (isMouseEvent(event)) {\n const rects = arrayFrom(instance.reference.getClientRects());\n const cursorRect = rects.find(\n (rect) =>\n rect.left - 2 <= event.clientX &&\n rect.right + 2 >= event.clientX &&\n rect.top - 2 <= event.clientY &&\n rect.bottom + 2 >= event.clientY\n );\n const index = rects.indexOf(cursorRect);\n cursorRectIndex = index > -1 ? index : cursorRectIndex;\n }\n },\n onHidden(): void {\n cursorRectIndex = -1;\n },\n };\n },\n};\n\nexport default inlinePositioning;\n\nexport function getInlineBoundingClientRect(\n currentBasePlacement: BasePlacement | null,\n boundingRect: DOMRect,\n clientRects: DOMRect[],\n cursorRectIndex: number\n): {\n top: number;\n bottom: number;\n left: number;\n right: number;\n width: number;\n height: number;\n} {\n // Not an inline element, or placement is not yet known\n if (clientRects.length < 2 || currentBasePlacement === null) {\n return boundingRect;\n }\n\n // There are two rects and they are disjoined\n if (\n clientRects.length === 2 &&\n cursorRectIndex >= 0 &&\n clientRects[0].left > clientRects[1].right\n ) {\n return clientRects[cursorRectIndex] || boundingRect;\n }\n\n switch (currentBasePlacement) {\n case 'top':\n case 'bottom': {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = currentBasePlacement === 'top';\n\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n\n return {top, bottom, left, right, width, height};\n }\n case 'left':\n case 'right': {\n const minLeft = Math.min(...clientRects.map((rects) => rects.left));\n const maxRight = Math.max(...clientRects.map((rects) => rects.right));\n const measureRects = clientRects.filter((rect) =>\n currentBasePlacement === 'left'\n ? rect.left === minLeft\n : rect.right === maxRight\n );\n\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n\n return {top, bottom, left, right, width, height};\n }\n default: {\n return boundingRect;\n }\n }\n}\n", "import {VirtualElement} from '@popperjs/core';\nimport {ReferenceElement, Sticky} from '../types';\n\nconst sticky: Sticky = {\n name: 'sticky',\n defaultValue: false,\n fn(instance) {\n const {reference, popper} = instance;\n\n function getReference(): ReferenceElement | VirtualElement {\n return instance.popperInstance\n ? instance.popperInstance.state.elements.reference\n : reference;\n }\n\n function shouldCheck(value: 'reference' | 'popper'): boolean {\n return instance.props.sticky === true || instance.props.sticky === value;\n }\n\n let prevRefRect: ClientRect | null = null;\n let prevPopRect: ClientRect | null = null;\n\n function updatePosition(): void {\n const currentRefRect = shouldCheck('reference')\n ? getReference().getBoundingClientRect()\n : null;\n const currentPopRect = shouldCheck('popper')\n ? popper.getBoundingClientRect()\n : null;\n\n if (\n (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect)) ||\n (currentPopRect && areRectsDifferent(prevPopRect, currentPopRect))\n ) {\n if (instance.popperInstance) {\n instance.popperInstance.update();\n }\n }\n\n prevRefRect = currentRefRect;\n prevPopRect = currentPopRect;\n\n if (instance.state.isMounted) {\n requestAnimationFrame(updatePosition);\n }\n }\n\n return {\n onMount(): void {\n if (instance.props.sticky) {\n updatePosition();\n }\n },\n };\n },\n};\n\nexport default sticky;\n\nfunction areRectsDifferent(\n rectA: ClientRect | null,\n rectB: ClientRect | null\n): boolean {\n if (rectA && rectB) {\n return (\n rectA.top !== rectB.top ||\n rectA.right !== rectB.right ||\n rectA.bottom !== rectB.bottom ||\n rectA.left !== rectB.left\n );\n }\n\n return true;\n}\n", "import tippy from '../src';\nimport {render} from '../src/template';\n\ntippy.setDefaultProps({render});\n\nexport {default, hideAll} from '../src';\nexport {default as createSingleton} from '../src/addons/createSingleton';\nexport {default as delegate} from '../src/addons/delegate';\nexport {default as animateFill} from '../src/plugins/animateFill';\nexport {default as followCursor} from '../src/plugins/followCursor';\nexport {default as inlinePositioning} from '../src/plugins/inlinePositioning';\nexport {default as sticky} from '../src/plugins/sticky';\nexport {ROUND_ARROW as roundArrow} from '../src/constants';\n", "import tippy, { Instance, Props } from 'tippy.js'\nimport { Controller } from '@hotwired/stimulus'\n\nexport class TooltipController extends Controller {\n static values = {\n message: String,\n followCursor: String,\n }\n\n declare tippyInstance: Instance<Props>\n declare messageValue: string\n declare followCursorValue?: 'horizontal' | 'vertical' | 'initial'\n\n connect(): void {\n this.tippyInstance = tippy(this.element, {\n animation: 'scale',\n content: this.messageValue,\n inertia: true,\n followCursor: this.followCursorValue,\n })\n }\n\n disconnect(): void {\n this.tippyInstance.destroy()\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { enter, leave } from 'el-transition'\n\nexport class ModalController extends Controller {\n static targets: string[] = [\n 'container',\n 'backdrop',\n 'panel',\n 'closeButton',\n 'overlay',\n 'content',\n ]\n static values = {\n allowBackgroundClose: { type: Boolean, default: true },\n restoreScroll: { type: Boolean, default: true },\n }\n\n scrollPosition?: number\n\n declare readonly contentTarget: HTMLDivElement\n declare readonly containerTarget: HTMLDivElement\n declare readonly backdropTarget: HTMLDivElement\n declare readonly panelTarget: HTMLDivElement\n declare readonly overlayTarget: HTMLDivElement\n declare readonly closeButtonTarget: HTMLButtonElement\n declare readonly hasContentTarget: boolean\n declare readonly hasCloseButtonTarget: boolean\n declare readonly hasBackdropTarget: boolean\n declare readonly hasPanelTarget: boolean\n declare allowBackgroundCloseValue: Boolean\n declare restoreScrollValue: Boolean\n\n show(): void {\n this.lockScroll()\n this.containerTarget.classList.remove('hidden')\n if (this.hasBackdropTarget) enter(this.backdropTarget)\n if (this.hasCloseButtonTarget) enter(this.closeButtonTarget)\n if (this.hasPanelTarget) enter(this.panelTarget)\n }\n\n open() {\n this.show()\n }\n\n async hide(): Promise<void> {\n this.unlockScroll()\n const promises: any[] = []\n if (this.hasBackdropTarget) promises.push(leave(this.backdropTarget))\n if (this.hasCloseButtonTarget) promises.push(leave(this.closeButtonTarget))\n if (this.hasPanelTarget) promises.push(leave(this.panelTarget))\n await Promise.all(promises)\n this.containerTarget.classList.add('hidden')\n }\n\n close() {\n this.hide()\n }\n\n closeBackground(event) {\n if (event.target === this.overlayTarget && this.allowBackgroundCloseValue) {\n this.hide()\n }\n }\n\n lockScroll() {\n // Add right padding to the body so the page doesn't shift\n // when we disable scrolling\n const scrollbarWidth =\n window.innerWidth - document.documentElement.clientWidth\n document.body.style.paddingRight = `${scrollbarWidth}px`\n\n // Save the scroll position\n this.saveScrollPosition()\n\n // Add classes to body to fix its position\n document.body.classList.add('fixed', 'inset-x-0', 'overflow-hidden')\n\n // Add negative top position in order for body to stay in place\n document.body.style.top = `-${this.scrollPosition}px`\n }\n\n unlockScroll() {\n // Remove tweaks for scrollbar\n document.body.style.removeProperty('paddingRight')\n\n // Remove classes from body to unfix position\n document.body.classList.remove('fixed', 'inset-x-0', 'overflow-hidden')\n\n // Restore the scroll position of the body before it got locked\n if (this.restoreScrollValue) {\n this.restoreScrollPosition()\n }\n\n // Remove the negative top inline style from body\n document.body.style.removeProperty('top')\n }\n\n saveScrollPosition() {\n this.scrollPosition = window.scrollY || document.body.scrollTop\n }\n\n restoreScrollPosition() {\n if (this.scrollPosition === undefined) return\n\n document.documentElement.scrollTop = this.scrollPosition\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { ModalController } from './modal_controller'\nimport Croppie from 'croppie'\nimport { DirectUpload } from '@rails/activestorage'\nimport Compressor from 'compressorjs'\n\nexport class AvatarPickerController extends Controller<HTMLInputElement> {\n static outlets: string[] = ['modal']\n static targets: string[] = ['input', 'preview']\n\n declare readonly modalOutlet: ModalController\n declare readonly inputTarget: HTMLInputElement\n declare readonly previewTarget: HTMLDivElement\n declare readonly hasInputTarget: boolean\n declare readonly hasPreviewTarget: boolean\n\n cropper?: Croppie\n\n connect(): void {\n if (!this.hasInputTarget) return\n this.inputTarget.addEventListener('change', this.onFileChange)\n }\n\n disconnect(): void {\n if (!this.hasInputTarget) return\n this.inputTarget.removeEventListener('change', this.onFileChange)\n }\n\n async confirmSelection(): Promise<void> {\n if (!this.cropper) return\n\n try {\n const blob = await this.cropper.result({\n circle: false,\n format: 'webp',\n quality: 1,\n size: 'original',\n type: 'blob',\n })\n\n const compressedFile = await this.compressFile(blob)\n if (!compressedFile) return // TODO: display an error here\n\n this.inputTarget.value = ''\n this.uploadFile(compressedFile)\n\n if (this.hasPreviewTarget) {\n const image = new Image()\n const objectURL = URL.createObjectURL(blob)\n const { height, width } = this.previewTarget.getBoundingClientRect()\n image.src = objectURL\n image.height = height\n image.width = width\n this.previewTarget.replaceChildren(image)\n }\n this.modalOutlet.hide()\n } catch (error) {\n console.log(error)\n }\n }\n\n private compressFile = async (blob: Blob): Promise<File | undefined> => {\n try {\n const result = await new Promise((resolve, reject) => {\n new Compressor(blob, {\n quality: 0.8,\n success: resolve,\n error: reject,\n strict: true,\n checkOrientation: true,\n })\n })\n\n const now = new Date().getTime()\n const file = new File([result as Blob], `avatar-${now}.webp`)\n return file\n } catch (error) {\n console.log(error)\n }\n }\n\n private uploadFile = (file: File): void => {\n // your form needs the file_field direct_upload: true, which\n // provides data-direct-upload-url\n const input = this.inputTarget\n const url = input.dataset.directUploadUrl\n const upload = new DirectUpload(file, url)\n\n upload.create((error, blob) => {\n if (error) {\n // Handle the error\n console.log('Error uploading file', error)\n } else {\n // Add an appropriately-named hidden input to the form with a\n // value of blob.signed_id so that the blob ids will be\n // transmitted in the normal upload flow\n const hiddenField = document.createElement('input')\n hiddenField.setAttribute('type', 'hidden')\n hiddenField.setAttribute('value', blob.signed_id)\n hiddenField.name = input.name\n this.inputTarget.after(hiddenField)\n }\n })\n }\n\n private onFileChange = (_event: Event): void => {\n const input = this.inputTarget\n const files = input.files\n if (!files) return\n\n const modal = this.modalOutlet\n const panel = modal.contentTarget\n const file = files[0]\n const reader = new FileReader()\n\n reader.onload = () => {\n if (!reader.result) return\n\n const image = new Image()\n image.src = reader.result\n image.height = 200\n panel.replaceChildren(image)\n\n this.cropper = new Croppie(image, {\n // enableResize: true,\n // enableZoom: false,\n customClass: 'h-80',\n showZoomer: true,\n viewport: {\n height: 320,\n width: 320,\n type: 'circle',\n },\n })\n\n // FIXME: there is a slight zoom issue on mount\n this.cropper.setZoom(50)\n // this.cropper.setZoom(0)\n }\n\n reader.readAsDataURL(file)\n\n modal.show()\n }\n}\n", "/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n", "import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n", "import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n", "import { slice } from './util';\nimport options from './options';\nimport { UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_component: null,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == null ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == null && options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor == UNDEFINED;\n", "import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tif (component._parentDom) {\n\t\tconst newVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c;\n\trerenderQueue.sort(depthSort);\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile ((c = rerenderQueue.shift())) {\n\t\tif (c._dirty) {\n\t\t\tlet renderQueueLength = rerenderQueue.length;\n\t\t\trenderComponent(c);\n\t\t\tif (rerenderQueue.length > renderQueueLength) {\n\t\t\t\t// When i.e. rerendering a provider additional new items can be injected, we want to\n\t\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t\t// single pass\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n", "import { IS_NON_DIMENSIONAL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == null ? '' : value);\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (\n\t\t\tname.toLowerCase() in dom ||\n\t\t\tname == 'onFocusOut' ||\n\t\t\tname == 'onFocusIn'\n\t\t)\n\t\t\tname = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != null && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e._dispatched == null) {\n\t\t\t\te._dispatched = eventClock++;\n\n\t\t\t\t// When `e._dispatched` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e._dispatched < eventHandler._attached) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n", "import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tProvider(props) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\t/** @type {Set<import('./internal').Component> | null} */\n\t\t\t\tlet subs = new Set();\n\t\t\t\tlet ctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\t\tsubs = null;\n\t\t\t\t};\n\n\t\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.add(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tif (subs) {\n\t\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType =\n\t\tcontext);\n}\n", "import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == null) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\tif (childVNode._index === -1) {\n\t\t\toldVNode = EMPTY_OBJ;\n\t\t} else {\n\t\t\toldVNode = oldChildren[childVNode._index] || EMPTY_OBJ;\n\t\t}\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, null, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == null && newDom != null) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tif (\n\t\t\tchildVNode._flags & INSERT_VNODE ||\n\t\t\toldVNode._children === childVNode._children\n\t\t) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom);\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == null ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = null;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse = <div />\n\t\t\t// <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : null,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = null;\n\t\tif (matchingIndex !== -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original === null\n\t\tconst isMounting = oldVNode == null || oldVNode._original === null;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\tskew--;\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t// we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t// this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != null && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (oldDom && parentVNode.type && !parentDom.contains(oldDom)) {\n\t\t\toldDom = getDomSibling(parentVNode);\n\t\t}\n\t\tparentDom.insertBefore(parentVNode._dom, oldDom || null);\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != null && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren >\n\t\t(oldVNode != null && (oldVNode._flags & MATCHED) == 0 ? 1 : 0);\n\n\tif (\n\t\toldVNode === null ||\n\t\t(oldVNode &&\n\t\t\tkey == oldVNode.key &&\n\t\t\ttype === oldVNode.type &&\n\t\t\t(oldVNode._flags & MATCHED) == 0)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tif (x >= 0) {\n\t\t\t\toldVNode = oldChildren[x];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t\tx--;\n\t\t\t}\n\n\t\t\tif (y < oldChildren.length) {\n\t\t\t\toldVNode = oldChildren[y];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn y;\n\t\t\t\t}\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n", "import {\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref<T>} Ref<T>\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent =\n\t\t\t\t'prototype' in newType && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!c._force &&\n\t\t\t\t\t((c.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\t\tnewVNode._original == oldVNode._original)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = null;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == null &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\n/**\n * @param {Array<Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (nodeType == null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t}\n\n\tif (nodeType === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != null) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (!(i in newProps)) {\n\t\t\t\tif (\n\t\t\t\t\t(i == 'value' && 'defaultValue' in newProps) ||\n\t\t\t\t\t(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsetProperty(dom, i, null, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html !== oldHtml.__html &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == null) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue !== UNDEFINED &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue !== oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked !== UNDEFINED && checked !== dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref<any> & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != null) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) {\n\t\t\tapplyRef(r, null, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n", "import { EMPTY_OBJ } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? null\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: null,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n", "import { assign, slice } from './util';\nimport { createVNode } from './create-element';\nimport { UNDEFINED } from './constants';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === UNDEFINED && defaultProps !== UNDEFINED) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n", "/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n", "import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array<import('./internal').Component>} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\nconst RAF_TIMEOUT = 100;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.forEach(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.forEach(invokeCleanup);\n\t\t\thooks._pendingEffects.forEach(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.forEach(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.forEach(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer<S, A>} reducer\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\t/** @type {(x: import('./internal').HookState) => x is import('./internal').ReducerHookState} */\n\t\t\t\tconst isStateHook = x => !!x._component;\n\t\t\t\tconst stateHooks =\n\t\t\t\t\thookState._component.__hooks._list.filter(isStateHook);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = hookState._component.props !== p;\n\t\t\t\tstateHooks.forEach(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn prevScu\n\t\t\t\t\t? prevScu.call(this, p, s, c) || shouldUpdate\n\t\t\t\t\t: shouldUpdate;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tref(createHandle());\n\t\t\t\treturn () => ref(null);\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState<T>} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tif (!component._parentDom || !component.__hooks) continue;\n\t\ttry {\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n", "import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n", "import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n", "import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n", "import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n", "import { addDays } from \"./addDays.mjs\";\n\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be added.\n *\n * @returns The new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * const result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nexport function addWeeks(date, amount) {\n const days = amount * 7;\n return addDays(date, days);\n}\n\n// Fallback for modularized imports:\nexport default addWeeks;\n", "import { startOfDay } from \"./startOfDay.mjs\";\n\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day (and year and month)?\n *\n * @description\n * Are the given dates in the same day (and year and month)?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to check\n * @param dateRight - The second date to check\n\n * @returns The dates are in the same day (and year and month)\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n *\n * @example\n * // Are 4 September and 4 October in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))\n * //=> false\n *\n * @example\n * // Are 4 September, 2014 and 4 September, 2015 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))\n * //=> false\n */\nexport function isSameDay(dateLeft, dateRight) {\n const dateLeftStartOfDay = startOfDay(dateLeft);\n const dateRightStartOfDay = startOfDay(dateRight);\n\n return +dateLeftStartOfDay === +dateRightStartOfDay;\n}\n\n// Fallback for modularized imports:\nexport default isSameDay;\n", "/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n", "import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n", "import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n", "import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n", "import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n", "import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n", "import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n", "import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n", "export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n", "import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n", "import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(date.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n const timestamp = date.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n", "const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n", "const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n", "import { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > \u26A0\uFE0F Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDay\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of week, 0 represents Sunday\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * const result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\nexport function getDay(date) {\n const _date = toDate(date);\n const day = _date.getDay();\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getDay;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date that should be after the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport function isAfter(date, dateToCompare) {\n const _date = toDate(date);\n const _dateToCompare = toDate(dateToCompare);\n return _date.getTime() > _dateToCompare.getTime();\n}\n\n// Fallback for modularized imports:\nexport default isAfter;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date that should be before the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport function isBefore(date, dateToCompare) {\n const _date = toDate(date);\n const _dateToCompare = toDate(dateToCompare);\n return +_date < +_dateToCompare;\n}\n\n// Fallback for modularized imports:\nexport default isBefore;\n", "import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * The {@link isSameWeek} function options.\n */\n\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week (and month and year)?\n *\n * @description\n * Are the given dates in the same week (and month and year)?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to check\n * @param dateRight - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same week (and month and year)\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same week?\n * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nexport function isSameWeek(dateLeft, dateRight, options) {\n const dateLeftStartOfWeek = startOfWeek(dateLeft, options);\n const dateRightStartOfWeek = startOfWeek(dateRight, options);\n\n return +dateLeftStartOfWeek === +dateRightStartOfWeek;\n}\n\n// Fallback for modularized imports:\nexport default isSameWeek;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isSameMonth\n * @category Month Helpers\n * @summary Are the given dates in the same month (and year)?\n *\n * @description\n * Are the given dates in the same month (and year)?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to check\n * @param dateRight - The second date to check\n *\n * @returns The dates are in the same month (and year)\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n *\n * @example\n * // Are 2 September 2014 and 25 September 2015 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))\n * //=> false\n */\nexport function isSameMonth(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n return (\n _dateLeft.getFullYear() === _dateRight.getFullYear() &&\n _dateLeft.getMonth() === _dateRight.getMonth()\n );\n}\n\n// Fallback for modularized imports:\nexport default isSameMonth;\n", "import { constructNow } from \"./constructNow.mjs\";\nimport { isSameWeek } from \"./isSameWeek.mjs\";\n\n/**\n * The {@link isThisWeek} function options.\n */\n\n/**\n * @name isThisWeek\n * @category Week Helpers\n * @summary Is the given date in the same week as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same week as the current date?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n * @param options - The object with options\n *\n * @returns The date is in this week\n *\n * @example\n * // If today is 25 September 2014, is 21 September 2014 in this week?\n * const result = isThisWeek(new Date(2014, 8, 21))\n * //=> true\n *\n * @example\n * // If today is 25 September 2014 and week starts with Monday\n * // is 21 September 2014 in this week?\n * const result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 })\n * //=> false\n */\nexport function isThisWeek(date, options) {\n return isSameWeek(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default isThisWeek;\n", "import { constructNow } from \"./constructNow.mjs\";\nimport { isSameDay } from \"./isSameDay.mjs\";\n\n/**\n * @name isToday\n * @category Day Helpers\n * @summary Is the given date today?\n * @pure false\n *\n * @description\n * Is the given date today?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is today\n *\n * @example\n * // If today is 6 October 2014, is 6 October 14:00:00 today?\n * const result = isToday(new Date(2014, 9, 6, 14, 0))\n * //=> true\n */\nexport function isToday(date) {\n return isSameDay(date, constructNow(date));\n}\n\n// Fallback for modularized imports:\nexport default isToday;\n", "import { addDays } from \"./addDays.mjs\";\nimport { constructNow } from \"./constructNow.mjs\";\nimport { isSameDay } from \"./isSameDay.mjs\";\n\n/**\n * @name isTomorrow\n * @category Day Helpers\n * @summary Is the given date tomorrow?\n * @pure false\n *\n * @description\n * Is the given date tomorrow?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is tomorrow\n *\n * @example\n * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow?\n * const result = isTomorrow(new Date(2014, 9, 7, 14, 0))\n * //=> true\n */\nexport function isTomorrow(date) {\n return isSameDay(date, addDays(constructNow(date), 1));\n}\n\n// Fallback for modularized imports:\nexport default isTomorrow;\n", "import { addDays } from \"./addDays.mjs\";\n\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be subtracted.\n *\n * @returns The new date with the days subtracted\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * const result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\nexport function subDays(date, amount) {\n return addDays(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subDays;\n", "import { addDays } from \"./addDays.mjs\";\nimport { getDay } from \"./getDay.mjs\";\n\n/**\n * @name nextDay\n * @category Weekday Helpers\n * @summary When is the next day of the week?\n *\n * @description\n * When is the next day of the week? 0-6 the day of the week, 0 represents Sunday.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n * @param day - day of the week\n *\n * @returns The date is the next day of week\n *\n * @example\n * // When is the next Monday after Mar, 20, 2020?\n * const result = nextDay(new Date(2020, 2, 20), 1)\n * //=> Mon Mar 23 2020 00:00:00\n *\n * @example\n * // When is the next Tuesday after Mar, 21, 2020?\n * const result = nextDay(new Date(2020, 2, 21), 2)\n * //=> Tue Mar 24 2020 00:00:00\n */\nexport function nextDay(date, day) {\n let delta = day - getDay(date);\n if (delta <= 0) delta += 7;\n\n return addDays(date, delta);\n}\n\n// Fallback for modularized imports:\nexport default nextDay;\n", "import { nextDay } from \"./nextDay.mjs\";\n\n/**\n * @name nextMonday\n * @category Weekday Helpers\n * @summary When is the next Monday?\n *\n * @description\n * When is the next Monday?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to start counting from\n *\n * @returns The next Monday\n *\n * @example\n * // When is the next Monday after Mar, 22, 2020?\n * const result = nextMonday(new Date(2020, 2, 22))\n * //=> Mon Mar 23 2020 00:00:00\n */\nexport function nextMonday(date) {\n return nextDay(date, 1);\n}\n\n// Fallback for modularized imports:\nexport default nextMonday;\n", "import { getDay } from \"./getDay.mjs\";\nimport { subDays } from \"./subDays.mjs\";\n\n/**\n * @name previousDay\n * @category Weekday Helpers\n * @summary When is the previous day of the week?\n *\n * @description\n * When is the previous day of the week? 0-6 the day of the week, 0 represents Sunday.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n * @param day - The day of the week\n *\n * @returns The date is the previous day of week\n *\n * @example\n * // When is the previous Monday before Mar, 20, 2020?\n * const result = previousDay(new Date(2020, 2, 20), 1)\n * //=> Mon Mar 16 2020 00:00:00\n *\n * @example\n * // When is the previous Tuesday before Mar, 21, 2020?\n * const result = previousDay(new Date(2020, 2, 21), 2)\n * //=> Tue Mar 17 2020 00:00:00\n */\nexport function previousDay(date, day) {\n let delta = getDay(date) - day;\n if (delta <= 0) delta += 7;\n\n return subDays(date, delta);\n}\n\n// Fallback for modularized imports:\nexport default previousDay;\n", "import { previousDay } from \"./previousDay.mjs\";\n\n/**\n * @name previousMonday\n * @category Weekday Helpers\n * @summary When is the previous Monday?\n *\n * @description\n * When is the previous Monday?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to start counting from\n *\n * @returns The previous Monday\n *\n * @example\n * // When is the previous Monday before Jun, 18, 2021?\n * const result = previousMonday(new Date(2021, 5, 18))\n * //=> Mon June 14 2021 00:00:00\n */\nexport function previousMonday(date) {\n return previousDay(date, 1);\n}\n\n// Fallback for modularized imports:\nexport default previousMonday;\n", "/**\n * @name startOfTomorrow\n * @category Day Helpers\n * @summary Return the start of tomorrow.\n * @pure false\n *\n * @description\n * Return the start of tomorrow.\n *\n * @returns The start of tomorrow\n *\n * @example\n * // If today is 6 October 2014:\n * const result = startOfTomorrow()\n * //=> Tue Oct 7 2014 00:00:00\n */\nexport function startOfTomorrow() {\n const now = new Date();\n const year = now.getFullYear();\n const month = now.getMonth();\n const day = now.getDate();\n\n const date = new Date(0);\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}\n\n// Fallback for modularized imports:\nexport default startOfTomorrow;\n", "import { h } from 'preact'\nimport classNames from 'classnames'\n\ninterface Props {\n onPress: () => void\n disabled?: boolean\n}\n\nexport function PreviousMonthButton({ onPress, disabled }: Props) {\n return (\n <button\n disabled={disabled}\n onClick={onPress}\n type=\"button\"\n class={classNames(\n 'inline-flex p-1 transition duration-100 ease-in-out rounded-full focus:outline-none focus:shadow-outline',\n {\n 'text-gray-400 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-700 cursor-pointer':\n !disabled,\n 'text-gray-200 dark:text-neutral-600 cursor-default': disabled,\n }\n )}\n >\n <svg\n class=\"inline-flex w-6 h-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M15 19l-7-7 7-7\"\n />\n </svg>\n </button>\n )\n}\n", "import { h } from 'preact'\nimport classnames from 'classnames'\n\ninterface Props {\n onPress: () => void\n disabled?: boolean\n}\n\nexport function NextMonthButton({ onPress, disabled = false }: Props) {\n return (\n <button\n disabled={disabled}\n onClick={onPress}\n type=\"button\"\n class={classnames(\n 'inline-flex p-1 transition duration-100 ease-in-out rounded-full focus:outline-none focus:shadow-outline',\n {\n 'text-gray-400 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-700 cursor-pointer':\n !disabled,\n 'text-gray-200 dark:text-neutral-600 cursor-default': disabled,\n }\n )}\n >\n <svg\n class=\"inline-flex w-6 h-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </button>\n )\n}\n", "import { h } from 'preact'\nimport { DayObject } from '../WeekPicker'\nimport { isAfter, isSameDay } from 'date-fns'\nimport classNames from 'classnames'\n\ninterface Props {\n date: Date\n year: number\n month: number\n week: DayObject[]\n onClick: (day: number) => void\n}\n\nexport function WeekRow({ date, month, year, week, onClick }: Props) {\n const firstDay = new Date(year, month, week[0].day)\n const hasMonday = firstDay.getDay() === 1\n const isFuture = isAfter(firstDay, new Date())\n\n function dateIsToday(day: number) {\n const today = new Date()\n const date = new Date(year, month, day)\n\n return isSameDay(today, date)\n }\n\n function datePickerIsSelectedDate(day: number): boolean {\n const d = new Date(year, month, day)\n return isSameDay(date, d)\n }\n\n return (\n <div\n onClick={() => {\n if (hasMonday && !isFuture) {\n onClick(week[0].day)\n }\n }}\n class={classNames('grid grid-cols-7 rounded-lg', {\n 'hover:bg-gray-200 dark:hover:bg-neutral-700 group cursor-pointer':\n hasMonday && !isFuture,\n })}\n >\n {week.map((day, dayIndex) => {\n if (day.type === 'blank') {\n return (\n <div\n key={`dayInMonth_${day.day}`}\n class=\"p-1 text-sm text-center border border-transparent\"\n ></div>\n )\n }\n\n return (\n <div\n key={`dayInMonth_${day.day}`}\n class=\"px-0.5 my-0.5 aspect-square flex items-center justify-center\"\n >\n <div\n class={classNames(\n 'flex items-center justify-center text-sm leading-none text-center rounded-full h-7 w-7',\n {\n 'text-gray-200 dark:text-neutral-600': isFuture,\n 'bg-gray-200 dark:bg-neutral-600':\n dateIsToday(day.day) == true,\n 'text-gray-600 dark:text-neutral-400':\n dateIsToday(day.day) == false &&\n datePickerIsSelectedDate(day.day) == false &&\n !isFuture,\n 'bg-primary-800 text-white': datePickerIsSelectedDate(\n day.day\n ),\n 'group-hover:bg-gray-300 dark:group-hover:bg-neutral-600':\n hasMonday && dayIndex === 0,\n }\n )}\n >\n {day.day}\n </div>\n </div>\n )\n })}\n </div>\n )\n}\n", "import { h } from 'preact'\nimport { useEffect, useState, useRef, useCallback } from 'preact/hooks'\nimport { format, previousMonday, startOfWeek } from 'date-fns'\nimport { PreviousMonthButton } from './WeekPicker/PreviousMonthButton'\nimport { NextMonthButton } from './WeekPicker/NextMonthButton'\nimport { WeekRow } from './WeekPicker/WeekRow'\nimport { Turbo } from '@hotwired/turbo-rails'\n\nconst DAY_NAMES = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']\nconst MONTH_NAMES: string[] = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n]\nconst DATE_FORMAT = 'dd MMM yy'\n\nfunction formatDate(date: Date) {\n return format(date, DATE_FORMAT)\n}\n\nfunction groupArray<T>(array: T[], num: number): T[][] {\n const group: T[][] = []\n\n for (let i = 0; i < array.length; i += num) {\n group.push(array.slice(i, i + num))\n }\n\n return group\n}\n\nfunction useOutsideClick(ref: any, onClickOut: () => void, deps: any[] = []) {\n useEffect(() => {\n const onClick = ({ target }: any) => {\n !ref?.contains(target) && onClickOut?.()\n }\n document.addEventListener('click', onClick)\n return () => document.removeEventListener('click', onClick)\n }, deps)\n}\n\ninterface Props {\n date?: Date\n}\n\nexport interface DayObject {\n day: number\n type: 'blank' | 'normal'\n}\n\nexport function WeekPicker({ date: initialDate = new Date() }: Props) {\n const [open, setOpen] = useState(false)\n const [date, setDate] = useState(initialDate)\n const [month, setMonth] = useState(initialDate.getMonth())\n const [year, setYear] = useState(initialDate.getFullYear())\n const [blankDaysInMonth, setBlankDaysInMonth] = useState<number[]>([])\n const [daysInMonth, setDaysInMonth] = useState<number[]>([])\n\n const containerRef = useRef<HTMLDivElement>()\n const today = useRef(new Date()).current\n\n const formattedDate = formatDate(date)\n const allDays: DayObject[] = [\n ...blankDaysInMonth.map(day => ({\n day,\n type: 'blank',\n })),\n ...daysInMonth.map(day => ({\n day,\n type: 'normal',\n })),\n ]\n const groupedDays = groupArray(allDays, 7)\n const atMaxMonth = today.getFullYear() === year && today.getMonth() === month\n\n useEffect(() => {\n document.addEventListener('keyup', closeWithKeyboard)\n\n return () => {\n document.removeEventListener('keyup', closeWithKeyboard)\n }\n }, [])\n\n useOutsideClick(\n containerRef.current,\n () => {\n setOpen(false)\n },\n [containerRef.current]\n )\n\n const toggleOpen = useCallback(() => {\n setOpen(currentValue => !currentValue)\n }, [])\n\n const showCalendar = useCallback(() => {\n setOpen(true)\n }, [])\n\n function datePickerCalculateDays() {\n const totalDaysInMonth = new Date(year, month + 1, 0).getDate()\n // find where to start calendar day of week\n const dayOfWeek = new Date(year, month).getDay()\n const dayIndex = dayOfWeek === 0 ? 6 : dayOfWeek - 1\n const blankDaysArray: number[] = []\n\n for (var i = 1; i <= dayIndex; i++) {\n blankDaysArray.push(i)\n }\n\n const daysArray: number[] = []\n for (var i = 1; i <= totalDaysInMonth; i++) {\n daysArray.push(i)\n }\n\n setBlankDaysInMonth(blankDaysArray)\n setDaysInMonth(daysArray)\n }\n\n useEffect(() => {\n datePickerCalculateDays()\n }, [date])\n\n useEffect(() => {\n datePickerCalculateDays()\n }, [month])\n\n const closeWithKeyboard = useCallback((event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpen(false)\n }\n }, [])\n\n const selectThisWeek = useCallback(() => {\n const today = new Date()\n const monday = startOfWeek(today, { weekStartsOn: 1 })\n\n dateSelected(monday)\n }, [])\n\n const selectLastWeek = useCallback(() => {\n const today = new Date()\n const monday = startOfWeek(today, { weekStartsOn: 1 })\n const lastMonday = previousMonday(monday)\n\n dateSelected(lastMonday)\n }, [])\n\n function dateSelected(selectedDate: Date): void {\n setDate(selectedDate)\n setOpen(false)\n\n const url = new URL(window.location.href)\n url.searchParams.set('week_commencing', format(selectedDate, 'yyyy-MM-dd'))\n Turbo.visit(url, {\n action: 'replace',\n })\n }\n\n function datePickerDayClicked(day: number) {\n const selectedDate = new Date(year, month, day)\n\n setDate(selectedDate)\n setOpen(false)\n\n const url = new URL(window.location.href)\n url.searchParams.set('week_commencing', format(selectedDate, 'yyyy-MM-dd'))\n Turbo.visit(url, {\n action: 'replace',\n })\n }\n\n function datePickerPreviousMonth() {\n if (month === 0) {\n setYear(year - 1)\n setMonth(11)\n } else {\n setMonth(month - 1)\n }\n }\n\n function datePickerNextMonth() {\n if (atMaxMonth) return\n\n if (month === 11) {\n setMonth(0)\n setYear(year + 1)\n } else {\n setMonth(month + 1)\n }\n }\n\n return (\n <div ref={containerRef} class=\"container block mb-1\">\n <div class=\"w-full\">\n <label\n for=\"week-commencing\"\n class=\"block mb-1 text-left text-sm/6 font-medium text-neutral-500\"\n >\n Week commencing\n </label>\n <div class=\"relative\">\n <input\n id=\"week-commencing\"\n type=\"text\"\n onFocus={showCalendar}\n value={formattedDate}\n class=\"flex w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-700 border rounded-md text-neutral-600 dark:text-neutral-300 border-gray-300 dark:border-neutral-600 ring-offset-background placeholder:text-neutral-400 dark:placeholder:text-neutral-600 focus:border-gray-300 dark:focus:border-neutral-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-400 disabled:cursor-not-allowed disabled:opacity-50\"\n placeholder=\"Select date\"\n readonly\n />\n <div\n onClick={toggleOpen}\n class=\"absolute top-0 right-0 px-3 py-2 cursor-pointer text-gray-400 dark:text-neutral-500 hover:text-gray-500 dark:hover:text-neutral-400\"\n >\n <svg\n class=\"w-6 h-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"\n />\n </svg>\n </div>\n {open && (\n <div class=\"absolute top-0 left-0 max-w-lg p-4 mt-12 antialiased bg-white dark:bg-neutral-800 border rounded-lg shadow w-[17rem] border-gray-200/70 dark:border-neutral-700\">\n <div class=\"flex items-center justify-between mb-2\">\n <div>\n <span class=\"text-lg font-bold text-gray-800 dark:text-neutral-300\">\n {MONTH_NAMES[month]}\n </span>\n <span class=\"ml-1 text-lg font-normal text-gray-600 dark:text-neutral-500\">\n {year}\n </span>\n </div>\n <div>\n <PreviousMonthButton onPress={datePickerPreviousMonth} />\n <NextMonthButton\n onPress={datePickerNextMonth}\n disabled={atMaxMonth}\n />\n </div>\n </div>\n <div class=\"grid grid-cols-7 mb-3\">\n {DAY_NAMES.map(day => (\n <div key={day} class=\"px-0.5\">\n <div class=\"text-xs font-medium text-center text-gray-800 dark:text-neutral-400\">\n {day}\n </div>\n </div>\n ))}\n </div>\n {groupedDays.map(group => (\n <WeekRow\n key={group}\n date={date}\n week={group}\n month={month}\n year={year}\n onClick={datePickerDayClicked}\n />\n ))}\n <div class=\"flex space-x-2 mt-2\">\n <button\n type=\"button\"\n class=\"button clear-btn text-gray-900 dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 dark:border-neutral-600 hover:bg-gray-100 dark:hover:bg-neutral-600 focus:ring-4 focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2 text-center w-1/2\"\n onClick={selectLastWeek}\n >\n Last week\n </button>\n <button\n type=\"button\"\n class=\"button today-btn text-white bg-primary-700 dark:bg-primary-600 hover:bg-primary-800 dark:hover:bg-primary-700 focus:ring-4 focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2 text-center w-1/2\"\n onClick={selectThisWeek}\n >\n This week\n </button>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n )\n}\n", "import { h, render } from 'preact'\nimport { Controller } from '@hotwired/stimulus'\nimport { WeekPicker } from '../components/WeekPicker'\n\nexport class WeekFilterController extends Controller {\n static values = {\n date: { type: String, default: new Date().toISOString() },\n }\n\n declare dateValue: string\n\n async connect() {\n let currentDate = new Date()\n if (this.dateValue) {\n currentDate = new Date(Date.parse(this.dateValue))\n }\n\n render(<WeekPicker date={currentDate} />, this.element)\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport class ScrollToBottomController extends Controller {\n observer?: MutationObserver\n\n observerConfig = {\n attributes: false,\n childList: true,\n subtree: false,\n }\n\n connect(): void {\n this.setupObserver()\n this.scrollToBottom()\n }\n\n disconnect(): void {\n this.stopObserver()\n }\n\n private scrollToBottom = (): void => {\n this.element.scrollTop =\n this.element.scrollHeight - this.element.clientHeight\n }\n\n private setupObserver() {\n this.observer = new MutationObserver(this.scrollToBottom)\n this.observer.observe(this.element, this.observerConfig)\n }\n\n private stopObserver() {\n this.observer?.disconnect()\n }\n}\n", "(function(){\"use strict\";try{if(typeof document<\"u\"){var e=document.createElement(\"style\");e.appendChild(document.createTextNode(\".ce-hint--align-start{text-align:left}.ce-hint--align-center{text-align:center}.ce-hint__description{opacity:.6;margin-top:3px}\")),document.head.appendChild(e)}}catch(t){console.error(\"vite-plugin-css-injected-by-js\",t)}})();\nvar Ce = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {};\nfunction Ke(n) {\n return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, \"default\") ? n.default : n;\n}\nfunction Xn(n) {\n if (n.__esModule)\n return n;\n var e = n.default;\n if (typeof e == \"function\") {\n var t = function o() {\n return this instanceof o ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);\n };\n t.prototype = e.prototype;\n } else\n t = {};\n return Object.defineProperty(t, \"__esModule\", { value: !0 }), Object.keys(n).forEach(function(o) {\n var i = Object.getOwnPropertyDescriptor(n, o);\n Object.defineProperty(t, o, i.get ? i : {\n enumerable: !0,\n get: function() {\n return n[o];\n }\n });\n }), t;\n}\nfunction ot() {\n}\nObject.assign(ot, {\n default: ot,\n register: ot,\n revert: function() {\n },\n __esModule: !0\n});\nElement.prototype.matches || (Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function(n) {\n const e = (this.document || this.ownerDocument).querySelectorAll(n);\n let t = e.length;\n for (; --t >= 0 && e.item(t) !== this; )\n ;\n return t > -1;\n});\nElement.prototype.closest || (Element.prototype.closest = function(n) {\n let e = this;\n if (!document.documentElement.contains(e))\n return null;\n do {\n if (e.matches(n))\n return e;\n e = e.parentElement || e.parentNode;\n } while (e !== null);\n return null;\n});\nElement.prototype.prepend || (Element.prototype.prepend = function(e) {\n const t = document.createDocumentFragment();\n Array.isArray(e) || (e = [e]), e.forEach((o) => {\n const i = o instanceof Node;\n t.appendChild(i ? o : document.createTextNode(o));\n }), this.insertBefore(t, this.firstChild);\n});\nElement.prototype.scrollIntoViewIfNeeded || (Element.prototype.scrollIntoViewIfNeeded = function(n) {\n n = arguments.length === 0 ? !0 : !!n;\n const e = this.parentNode, t = window.getComputedStyle(e, null), o = parseInt(t.getPropertyValue(\"border-top-width\")), i = parseInt(t.getPropertyValue(\"border-left-width\")), s = this.offsetTop - e.offsetTop < e.scrollTop, r = this.offsetTop - e.offsetTop + this.clientHeight - o > e.scrollTop + e.clientHeight, a = this.offsetLeft - e.offsetLeft < e.scrollLeft, l = this.offsetLeft - e.offsetLeft + this.clientWidth - i > e.scrollLeft + e.clientWidth, c = s && !r;\n (s || r) && n && (e.scrollTop = this.offsetTop - e.offsetTop - e.clientHeight / 2 - o + this.clientHeight / 2), (a || l) && n && (e.scrollLeft = this.offsetLeft - e.offsetLeft - e.clientWidth / 2 - i + this.clientWidth / 2), (s || r || a || l) && !n && this.scrollIntoView(c);\n});\nwindow.requestIdleCallback = window.requestIdleCallback || function(n) {\n const e = Date.now();\n return setTimeout(function() {\n n({\n didTimeout: !1,\n timeRemaining: function() {\n return Math.max(0, 50 - (Date.now() - e));\n }\n });\n }, 1);\n};\nwindow.cancelIdleCallback = window.cancelIdleCallback || function(n) {\n clearTimeout(n);\n};\nlet Vn = (n = 21) => crypto.getRandomValues(new Uint8Array(n)).reduce((e, t) => (t &= 63, t < 36 ? e += t.toString(36) : t < 62 ? e += (t - 26).toString(36).toUpperCase() : t > 62 ? e += \"-\" : e += \"_\", e), \"\");\nvar Lo = /* @__PURE__ */ ((n) => (n.VERBOSE = \"VERBOSE\", n.INFO = \"INFO\", n.WARN = \"WARN\", n.ERROR = \"ERROR\", n))(Lo || {});\nconst y = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n SHIFT: 16,\n CTRL: 17,\n ALT: 18,\n ESC: 27,\n SPACE: 32,\n LEFT: 37,\n UP: 38,\n DOWN: 40,\n RIGHT: 39,\n DELETE: 46,\n META: 91,\n SLASH: 191\n}, qn = {\n LEFT: 0,\n WHEEL: 1,\n RIGHT: 2,\n BACKWARD: 3,\n FORWARD: 4\n};\nfunction Ie(n, e, t = \"log\", o, i = \"color: inherit\") {\n if (!(\"console\" in window) || !window.console[t])\n return;\n const s = [\"info\", \"log\", \"warn\", \"error\"].includes(t), r = [];\n switch (Ie.logLevel) {\n case \"ERROR\":\n if (t !== \"error\")\n return;\n break;\n case \"WARN\":\n if (![\"error\", \"warn\"].includes(t))\n return;\n break;\n case \"INFO\":\n if (!s || n)\n return;\n break;\n }\n o && r.push(o);\n const a = \"Editor.js 2.31.0-rc.7\", l = `line-height: 1em;\n color: #006FEA;\n display: inline-block;\n font-size: 11px;\n line-height: 1em;\n background-color: #fff;\n padding: 4px 9px;\n border-radius: 30px;\n border: 1px solid rgba(56, 138, 229, 0.16);\n margin: 4px 5px 4px 0;`;\n n && (s ? (r.unshift(l, i), e = `%c${a}%c ${e}`) : e = `( ${a} )${e}`);\n try {\n s ? o ? console[t](`${e} %o`, ...r) : console[t](e, ...r) : console[t](e);\n } catch {\n }\n}\nIe.logLevel = \"VERBOSE\";\nfunction Zn(n) {\n Ie.logLevel = n;\n}\nconst S = Ie.bind(window, !1), X = Ie.bind(window, !0);\nfunction le(n) {\n return Object.prototype.toString.call(n).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\nfunction A(n) {\n return le(n) === \"function\" || le(n) === \"asyncfunction\";\n}\nfunction D(n) {\n return le(n) === \"object\";\n}\nfunction te(n) {\n return le(n) === \"string\";\n}\nfunction Gn(n) {\n return le(n) === \"boolean\";\n}\nfunction yo(n) {\n return le(n) === \"number\";\n}\nfunction wo(n) {\n return le(n) === \"undefined\";\n}\nfunction V(n) {\n return n ? Object.keys(n).length === 0 && n.constructor === Object : !0;\n}\nfunction Po(n) {\n return n > 47 && n < 58 || // number keys\n n === 32 || n === 13 || // Space bar & return key(s)\n n === 229 || // processing key input for certain languages \u2014 Chinese, Japanese, etc.\n n > 64 && n < 91 || // letter keys\n n > 95 && n < 112 || // Numpad keys\n n > 185 && n < 193 || // ;=,-./` (in order)\n n > 218 && n < 223;\n}\nasync function Qn(n, e = () => {\n}, t = () => {\n}) {\n async function o(i, s, r) {\n try {\n await i.function(i.data), await s(wo(i.data) ? {} : i.data);\n } catch {\n r(wo(i.data) ? {} : i.data);\n }\n }\n return n.reduce(async (i, s) => (await i, o(s, e, t)), Promise.resolve());\n}\nfunction No(n) {\n return Array.prototype.slice.call(n);\n}\nfunction Fe(n, e) {\n return function() {\n const t = this, o = arguments;\n window.setTimeout(() => n.apply(t, o), e);\n };\n}\nfunction Jn(n) {\n return n.name.split(\".\").pop();\n}\nfunction ei(n) {\n return /^[-\\w]+\\/([-+\\w]+|\\*)$/.test(n);\n}\nfunction Eo(n, e, t) {\n let o;\n return (...i) => {\n const s = this, r = () => {\n o = null, t || n.apply(s, i);\n }, a = t && !o;\n window.clearTimeout(o), o = window.setTimeout(r, e), a && n.apply(s, i);\n };\n}\nfunction dt(n, e, t = void 0) {\n let o, i, s, r = null, a = 0;\n t || (t = {});\n const l = function() {\n a = t.leading === !1 ? 0 : Date.now(), r = null, s = n.apply(o, i), r || (o = i = null);\n };\n return function() {\n const c = Date.now();\n !a && t.leading === !1 && (a = c);\n const u = e - (c - a);\n return o = this, i = arguments, u <= 0 || u > e ? (r && (clearTimeout(r), r = null), a = c, s = n.apply(o, i), r || (o = i = null)) : !r && t.trailing !== !1 && (r = setTimeout(l, u)), s;\n };\n}\nfunction ti() {\n const n = {\n win: !1,\n mac: !1,\n x11: !1,\n linux: !1\n }, e = Object.keys(n).find((t) => window.navigator.appVersion.toLowerCase().indexOf(t) !== -1);\n return e && (n[e] = !0), n;\n}\nfunction je(n) {\n return n[0].toUpperCase() + n.slice(1);\n}\nfunction ut(n, ...e) {\n if (!e.length)\n return n;\n const t = e.shift();\n if (D(n) && D(t))\n for (const o in t)\n D(t[o]) ? (n[o] || Object.assign(n, { [o]: {} }), ut(n[o], t[o])) : Object.assign(n, { [o]: t[o] });\n return ut(n, ...e);\n}\nfunction vt(n) {\n const e = ti();\n return n = n.replace(/shift/gi, \"\u21E7\").replace(/backspace/gi, \"\u232B\").replace(/enter/gi, \"\u23CE\").replace(/up/gi, \"\u2191\").replace(/left/gi, \"\u2192\").replace(/down/gi, \"\u2193\").replace(/right/gi, \"\u2190\").replace(/escape/gi, \"\u238B\").replace(/insert/gi, \"Ins\").replace(/delete/gi, \"\u2421\").replace(/\\+/gi, \" + \"), e.mac ? n = n.replace(/ctrl|cmd/gi, \"\u2318\").replace(/alt/gi, \"\u2325\") : n = n.replace(/cmd/gi, \"Ctrl\").replace(/windows/gi, \"WIN\"), n;\n}\nfunction oi(n) {\n try {\n return new URL(n).href;\n } catch {\n }\n return n.substring(0, 2) === \"//\" ? window.location.protocol + n : window.location.origin + n;\n}\nfunction ni() {\n return Vn(10);\n}\nfunction ii(n) {\n window.open(n, \"_blank\");\n}\nfunction si(n = \"\") {\n return `${n}${Math.floor(Math.random() * 1e8).toString(16)}`;\n}\nfunction ht(n, e, t) {\n const o = `\u00AB${e}\u00BB is deprecated and will be removed in the next major release. Please use the \u00AB${t}\u00BB instead.`;\n n && X(o, \"warn\");\n}\nfunction me(n, e, t) {\n const o = t.value ? \"value\" : \"get\", i = t[o], s = `#${e}Cache`;\n if (t[o] = function(...r) {\n return this[s] === void 0 && (this[s] = i.apply(this, ...r)), this[s];\n }, o === \"get\" && t.set) {\n const r = t.set;\n t.set = function(a) {\n delete n[s], r.apply(this, a);\n };\n }\n return t;\n}\nconst Ro = 650;\nfunction be() {\n return window.matchMedia(`(max-width: ${Ro}px)`).matches;\n}\nconst pt = typeof window < \"u\" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === \"MacIntel\" && window.navigator.maxTouchPoints > 1);\nfunction ri(n, e) {\n const t = Array.isArray(n) || D(n), o = Array.isArray(e) || D(e);\n return t || o ? JSON.stringify(n) === JSON.stringify(e) : n === e;\n}\nclass d {\n /**\n * Check if passed tag has no closed tag\n *\n * @param {HTMLElement} tag - element to check\n * @returns {boolean}\n */\n static isSingleTag(e) {\n return e.tagName && [\n \"AREA\",\n \"BASE\",\n \"BR\",\n \"COL\",\n \"COMMAND\",\n \"EMBED\",\n \"HR\",\n \"IMG\",\n \"INPUT\",\n \"KEYGEN\",\n \"LINK\",\n \"META\",\n \"PARAM\",\n \"SOURCE\",\n \"TRACK\",\n \"WBR\"\n ].includes(e.tagName);\n }\n /**\n * Check if element is BR or WBR\n *\n * @param {HTMLElement} element - element to check\n * @returns {boolean}\n */\n static isLineBreakTag(e) {\n return e && e.tagName && [\n \"BR\",\n \"WBR\"\n ].includes(e.tagName);\n }\n /**\n * Helper for making Elements with class name and attributes\n *\n * @param {string} tagName - new Element tag name\n * @param {string[]|string} [classNames] - list or name of CSS class name(s)\n * @param {object} [attributes] - any attributes\n * @returns {HTMLElement}\n */\n static make(e, t = null, o = {}) {\n const i = document.createElement(e);\n if (Array.isArray(t)) {\n const s = t.filter((r) => r !== void 0);\n i.classList.add(...s);\n } else\n t && i.classList.add(t);\n for (const s in o)\n Object.prototype.hasOwnProperty.call(o, s) && (i[s] = o[s]);\n return i;\n }\n /**\n * Creates Text Node with the passed content\n *\n * @param {string} content - text content\n * @returns {Text}\n */\n static text(e) {\n return document.createTextNode(e);\n }\n /**\n * Append one or several elements to the parent\n *\n * @param {Element|DocumentFragment} parent - where to append\n * @param {Element|Element[]|DocumentFragment|Text|Text[]} elements - element or elements list\n */\n static append(e, t) {\n Array.isArray(t) ? t.forEach((o) => e.appendChild(o)) : e.appendChild(t);\n }\n /**\n * Append element or a couple to the beginning of the parent elements\n *\n * @param {Element} parent - where to append\n * @param {Element|Element[]} elements - element or elements list\n */\n static prepend(e, t) {\n Array.isArray(t) ? (t = t.reverse(), t.forEach((o) => e.prepend(o))) : e.prepend(t);\n }\n /**\n * Swap two elements in parent\n *\n * @param {HTMLElement} el1 - from\n * @param {HTMLElement} el2 - to\n * @deprecated\n */\n static swap(e, t) {\n const o = document.createElement(\"div\"), i = e.parentNode;\n i.insertBefore(o, e), i.insertBefore(e, t), i.insertBefore(t, o), i.removeChild(o);\n }\n /**\n * Selector Decorator\n *\n * Returns first match\n *\n * @param {Element} el - element we searching inside. Default - DOM Document\n * @param {string} selector - searching string\n * @returns {Element}\n */\n static find(e = document, t) {\n return e.querySelector(t);\n }\n /**\n * Get Element by Id\n *\n * @param {string} id - id to find\n * @returns {HTMLElement | null}\n */\n static get(e) {\n return document.getElementById(e);\n }\n /**\n * Selector Decorator.\n *\n * Returns all matches\n *\n * @param {Element|Document} el - element we searching inside. Default - DOM Document\n * @param {string} selector - searching string\n * @returns {NodeList}\n */\n static findAll(e = document, t) {\n return e.querySelectorAll(t);\n }\n /**\n * Returns CSS selector for all text inputs\n */\n static get allInputsSelector() {\n return \"[contenteditable=true], textarea, input:not([type]), \" + [\"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", \"url\"].map((t) => `input[type=\"${t}\"]`).join(\", \");\n }\n /**\n * Find all contenteditable, textarea and editable input elements passed holder contains\n *\n * @param holder - element where to find inputs\n */\n static findAllInputs(e) {\n return No(e.querySelectorAll(d.allInputsSelector)).reduce((t, o) => d.isNativeInput(o) || d.containsOnlyInlineElements(o) ? [...t, o] : [...t, ...d.getDeepestBlockElements(o)], []);\n }\n /**\n * Search for deepest node which is Leaf.\n * Leaf is the vertex that doesn't have any child nodes\n *\n * @description Method recursively goes throw the all Node until it finds the Leaf\n * @param {Node} node - root Node. From this vertex we start Deep-first search\n * {@link https://en.wikipedia.org/wiki/Depth-first_search}\n * @param {boolean} [atLast] - find last text node\n * @returns - it can be text Node or Element Node, so that caret will able to work with it\n * Can return null if node is Document or DocumentFragment, or node is not attached to the DOM\n */\n static getDeepestNode(e, t = !1) {\n const o = t ? \"lastChild\" : \"firstChild\", i = t ? \"previousSibling\" : \"nextSibling\";\n if (e && e.nodeType === Node.ELEMENT_NODE && e[o]) {\n let s = e[o];\n if (d.isSingleTag(s) && !d.isNativeInput(s) && !d.isLineBreakTag(s))\n if (s[i])\n s = s[i];\n else if (s.parentNode[i])\n s = s.parentNode[i];\n else\n return s.parentNode;\n return this.getDeepestNode(s, t);\n }\n return e;\n }\n /**\n * Check if object is DOM node\n *\n * @param {*} node - object to check\n * @returns {boolean}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static isElement(e) {\n return yo(e) ? !1 : e && e.nodeType && e.nodeType === Node.ELEMENT_NODE;\n }\n /**\n * Check if object is DocumentFragment node\n *\n * @param {object} node - object to check\n * @returns {boolean}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static isFragment(e) {\n return yo(e) ? !1 : e && e.nodeType && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;\n }\n /**\n * Check if passed element is contenteditable\n *\n * @param {HTMLElement} element - html element to check\n * @returns {boolean}\n */\n static isContentEditable(e) {\n return e.contentEditable === \"true\";\n }\n /**\n * Checks target if it is native input\n *\n * @param {*} target - HTML element or string\n * @returns {boolean}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static isNativeInput(e) {\n const t = [\n \"INPUT\",\n \"TEXTAREA\"\n ];\n return e && e.tagName ? t.includes(e.tagName) : !1;\n }\n /**\n * Checks if we can set caret\n *\n * @param {HTMLElement} target - target to check\n * @returns {boolean}\n */\n static canSetCaret(e) {\n let t = !0;\n if (d.isNativeInput(e))\n switch (e.type) {\n case \"file\":\n case \"checkbox\":\n case \"radio\":\n case \"hidden\":\n case \"submit\":\n case \"button\":\n case \"image\":\n case \"reset\":\n t = !1;\n break;\n }\n else\n t = d.isContentEditable(e);\n return t;\n }\n /**\n * Checks node if it is empty\n *\n * @description Method checks simple Node without any childs for emptiness\n * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method\n * @param {Node} node - node to check\n * @param {string} [ignoreChars] - char or substring to treat as empty\n * @returns {boolean} true if it is empty\n */\n static isNodeEmpty(e, t) {\n let o;\n return this.isSingleTag(e) && !this.isLineBreakTag(e) ? !1 : (this.isElement(e) && this.isNativeInput(e) ? o = e.value : o = e.textContent.replace(\"\u200B\", \"\"), t && (o = o.replace(new RegExp(t, \"g\"), \"\")), o.length === 0);\n }\n /**\n * checks node if it is doesn't have any child nodes\n *\n * @param {Node} node - node to check\n * @returns {boolean}\n */\n static isLeaf(e) {\n return e ? e.childNodes.length === 0 : !1;\n }\n /**\n * breadth-first search (BFS)\n * {@link https://en.wikipedia.org/wiki/Breadth-first_search}\n *\n * @description Pushes to stack all DOM leafs and checks for emptiness\n * @param {Node} node - node to check\n * @param {string} [ignoreChars] - char or substring to treat as empty\n * @returns {boolean}\n */\n static isEmpty(e, t) {\n const o = [e];\n for (; o.length > 0; )\n if (e = o.shift(), !!e) {\n if (this.isLeaf(e) && !this.isNodeEmpty(e, t))\n return !1;\n e.childNodes && o.push(...Array.from(e.childNodes));\n }\n return !0;\n }\n /**\n * Check if string contains html elements\n *\n * @param {string} str - string to check\n * @returns {boolean}\n */\n static isHTMLString(e) {\n const t = d.make(\"div\");\n return t.innerHTML = e, t.childElementCount > 0;\n }\n /**\n * Return length of node`s text content\n *\n * @param {Node} node - node with content\n * @returns {number}\n */\n static getContentLength(e) {\n return d.isNativeInput(e) ? e.value.length : e.nodeType === Node.TEXT_NODE ? e.length : e.textContent.length;\n }\n /**\n * Return array of names of block html elements\n *\n * @returns {string[]}\n */\n static get blockElements() {\n return [\n \"address\",\n \"article\",\n \"aside\",\n \"blockquote\",\n \"canvas\",\n \"div\",\n \"dl\",\n \"dt\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"footer\",\n \"form\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"li\",\n \"main\",\n \"nav\",\n \"noscript\",\n \"ol\",\n \"output\",\n \"p\",\n \"pre\",\n \"ruby\",\n \"section\",\n \"table\",\n \"tbody\",\n \"thead\",\n \"tr\",\n \"tfoot\",\n \"ul\",\n \"video\"\n ];\n }\n /**\n * Check if passed content includes only inline elements\n *\n * @param {string|HTMLElement} data - element or html string\n * @returns {boolean}\n */\n static containsOnlyInlineElements(e) {\n let t;\n te(e) ? (t = document.createElement(\"div\"), t.innerHTML = e) : t = e;\n const o = (i) => !d.blockElements.includes(i.tagName.toLowerCase()) && Array.from(i.children).every(o);\n return Array.from(t.children).every(o);\n }\n /**\n * Find and return all block elements in the passed parent (including subtree)\n *\n * @param {HTMLElement} parent - root element\n * @returns {HTMLElement[]}\n */\n static getDeepestBlockElements(e) {\n return d.containsOnlyInlineElements(e) ? [e] : Array.from(e.children).reduce((t, o) => [...t, ...d.getDeepestBlockElements(o)], []);\n }\n /**\n * Helper for get holder from {string} or return HTMLElement\n *\n * @param {string | HTMLElement} element - holder's id or holder's HTML Element\n * @returns {HTMLElement}\n */\n static getHolder(e) {\n return te(e) ? document.getElementById(e) : e;\n }\n /**\n * Returns true if element is anchor (is A tag)\n *\n * @param {Element} element - element to check\n * @returns {boolean}\n */\n static isAnchor(e) {\n return e.tagName.toLowerCase() === \"a\";\n }\n /**\n * Return element's offset related to the document\n *\n * @todo handle case when editor initialized in scrollable popup\n * @param el - element to compute offset\n */\n static offset(e) {\n const t = e.getBoundingClientRect(), o = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop, s = t.top + i, r = t.left + o;\n return {\n top: s,\n left: r,\n bottom: s + t.height,\n right: r + t.width\n };\n }\n}\nfunction ai(n) {\n return !/[^\\t\\n\\r ]/.test(n);\n}\nfunction li(n) {\n const e = window.getComputedStyle(n), t = parseFloat(e.fontSize), o = parseFloat(e.lineHeight) || t * 1.2, i = parseFloat(e.paddingTop), s = parseFloat(e.borderTopWidth), r = parseFloat(e.marginTop), a = t * 0.8, l = (o - t) / 2;\n return r + s + i + l + a;\n}\nfunction Do(n) {\n n.dataset.empty = d.isEmpty(n) ? \"true\" : \"false\";\n}\nconst ci = {\n blockTunes: {\n toggler: {\n \"Click to tune\": \"\",\n \"or drag to move\": \"\"\n }\n },\n inlineToolbar: {\n converter: {\n \"Convert to\": \"\"\n }\n },\n toolbar: {\n toolbox: {\n Add: \"\"\n }\n },\n popover: {\n Filter: \"\",\n \"Nothing found\": \"\",\n \"Convert to\": \"\"\n }\n}, di = {\n Text: \"\",\n Link: \"\",\n Bold: \"\",\n Italic: \"\"\n}, ui = {\n link: {\n \"Add a link\": \"\"\n },\n stub: {\n \"The block can not be displayed correctly.\": \"\"\n }\n}, hi = {\n delete: {\n Delete: \"\",\n \"Click to delete\": \"\"\n },\n moveUp: {\n \"Move up\": \"\"\n },\n moveDown: {\n \"Move down\": \"\"\n }\n}, Fo = {\n ui: ci,\n toolNames: di,\n tools: ui,\n blockTunes: hi\n}, jo = class he {\n /**\n * Type-safe translation for internal UI texts:\n * Perform translation of the string by namespace and a key\n *\n * @example I18n.ui(I18nInternalNS.ui.blockTunes.toggler, 'Click to tune')\n * @param internalNamespace - path to translated string in dictionary\n * @param dictKey - dictionary key. Better to use default locale original text\n */\n static ui(e, t) {\n return he._t(e, t);\n }\n /**\n * Translate for external strings that is not presented in default dictionary.\n * For example, for user-specified tool names\n *\n * @param namespace - path to translated string in dictionary\n * @param dictKey - dictionary key. Better to use default locale original text\n */\n static t(e, t) {\n return he._t(e, t);\n }\n /**\n * Adjust module for using external dictionary\n *\n * @param dictionary - new messages list to override default\n */\n static setDictionary(e) {\n he.currentDictionary = e;\n }\n /**\n * Perform translation both for internal and external namespaces\n * If there is no translation found, returns passed key as a translated message\n *\n * @param namespace - path to translated string in dictionary\n * @param dictKey - dictionary key. Better to use default locale original text\n */\n static _t(e, t) {\n const o = he.getNamespace(e);\n return !o || !o[t] ? t : o[t];\n }\n /**\n * Find messages section by namespace path\n *\n * @param namespace - path to section\n */\n static getNamespace(e) {\n return e.split(\".\").reduce((o, i) => !o || !Object.keys(o).length ? {} : o[i], he.currentDictionary);\n }\n};\njo.currentDictionary = Fo;\nlet z = jo;\nclass Ho extends Error {\n}\nclass Oe {\n constructor() {\n this.subscribers = {};\n }\n /**\n * Subscribe any event on callback\n *\n * @param eventName - event name\n * @param callback - subscriber\n */\n on(e, t) {\n e in this.subscribers || (this.subscribers[e] = []), this.subscribers[e].push(t);\n }\n /**\n * Subscribe any event on callback. Callback will be called once and be removed from subscribers array after call.\n *\n * @param eventName - event name\n * @param callback - subscriber\n */\n once(e, t) {\n e in this.subscribers || (this.subscribers[e] = []);\n const o = (i) => {\n const s = t(i), r = this.subscribers[e].indexOf(o);\n return r !== -1 && this.subscribers[e].splice(r, 1), s;\n };\n this.subscribers[e].push(o);\n }\n /**\n * Emit callbacks with passed data\n *\n * @param eventName - event name\n * @param data - subscribers get this data when they were fired\n */\n emit(e, t) {\n V(this.subscribers) || !this.subscribers[e] || this.subscribers[e].reduce((o, i) => {\n const s = i(o);\n return s !== void 0 ? s : o;\n }, t);\n }\n /**\n * Unsubscribe callback from event\n *\n * @param eventName - event name\n * @param callback - event handler\n */\n off(e, t) {\n if (this.subscribers[e] === void 0) {\n console.warn(`EventDispatcher .off(): there is no subscribers for event \"${e.toString()}\". Probably, .off() called before .on()`);\n return;\n }\n for (let o = 0; o < this.subscribers[e].length; o++)\n if (this.subscribers[e][o] === t) {\n delete this.subscribers[e][o];\n break;\n }\n }\n /**\n * Destroyer\n * clears subscribers list\n */\n destroy() {\n this.subscribers = {};\n }\n}\nfunction J(n) {\n Object.setPrototypeOf(this, {\n /**\n * Block id\n *\n * @returns {string}\n */\n get id() {\n return n.id;\n },\n /**\n * Tool name\n *\n * @returns {string}\n */\n get name() {\n return n.name;\n },\n /**\n * Tool config passed on Editor's initialization\n *\n * @returns {ToolConfig}\n */\n get config() {\n return n.config;\n },\n /**\n * .ce-block element, that wraps plugin contents\n *\n * @returns {HTMLElement}\n */\n get holder() {\n return n.holder;\n },\n /**\n * True if Block content is empty\n *\n * @returns {boolean}\n */\n get isEmpty() {\n return n.isEmpty;\n },\n /**\n * True if Block is selected with Cross-Block selection\n *\n * @returns {boolean}\n */\n get selected() {\n return n.selected;\n },\n /**\n * Set Block's stretch state\n *\n * @param {boolean} state \u2014 state to set\n */\n set stretched(t) {\n n.stretched = t;\n },\n /**\n * True if Block is stretched\n *\n * @returns {boolean}\n */\n get stretched() {\n return n.stretched;\n },\n /**\n * True if Block has inputs to be focused\n */\n get focusable() {\n return n.focusable;\n },\n /**\n * Call Tool method with errors handler under-the-hood\n *\n * @param {string} methodName - method to call\n * @param {object} param - object with parameters\n * @returns {unknown}\n */\n call(t, o) {\n return n.call(t, o);\n },\n /**\n * Save Block content\n *\n * @returns {Promise<void|SavedData>}\n */\n save() {\n return n.save();\n },\n /**\n * Validate Block data\n *\n * @param {BlockToolData} data - data to validate\n * @returns {Promise<boolean>}\n */\n validate(t) {\n return n.validate(t);\n },\n /**\n * Allows to say Editor that Block was changed. Used to manually trigger Editor's 'onChange' callback\n * Can be useful for block changes invisible for editor core.\n */\n dispatchChange() {\n n.dispatchChange();\n },\n /**\n * Tool could specify several entries to be displayed at the Toolbox (for example, \"Heading 1\", \"Heading 2\", \"Heading 3\")\n * This method returns the entry that is related to the Block (depended on the Block data)\n */\n getActiveToolboxEntry() {\n return n.getActiveToolboxEntry();\n }\n });\n}\nclass _e {\n constructor() {\n this.allListeners = [];\n }\n /**\n * Assigns event listener on element and returns unique identifier\n *\n * @param {EventTarget} element - DOM element that needs to be listened\n * @param {string} eventType - event type\n * @param {Function} handler - method that will be fired on event\n * @param {boolean|AddEventListenerOptions} options - useCapture or {capture, passive, once}\n */\n on(e, t, o, i = !1) {\n const s = si(\"l\"), r = {\n id: s,\n element: e,\n eventType: t,\n handler: o,\n options: i\n };\n if (!this.findOne(e, t, o))\n return this.allListeners.push(r), e.addEventListener(t, o, i), s;\n }\n /**\n * Removes event listener from element\n *\n * @param {EventTarget} element - DOM element that we removing listener\n * @param {string} eventType - event type\n * @param {Function} handler - remove handler, if element listens several handlers on the same event type\n * @param {boolean|AddEventListenerOptions} options - useCapture or {capture, passive, once}\n */\n off(e, t, o, i) {\n const s = this.findAll(e, t, o);\n s.forEach((r, a) => {\n const l = this.allListeners.indexOf(s[a]);\n l > -1 && (this.allListeners.splice(l, 1), r.element.removeEventListener(r.eventType, r.handler, r.options));\n });\n }\n /**\n * Removes listener by id\n *\n * @param {string} id - listener identifier\n */\n offById(e) {\n const t = this.findById(e);\n t && t.element.removeEventListener(t.eventType, t.handler, t.options);\n }\n /**\n * Finds and returns first listener by passed params\n *\n * @param {EventTarget} element - event target\n * @param {string} [eventType] - event type\n * @param {Function} [handler] - event handler\n * @returns {ListenerData|null}\n */\n findOne(e, t, o) {\n const i = this.findAll(e, t, o);\n return i.length > 0 ? i[0] : null;\n }\n /**\n * Return all stored listeners by passed params\n *\n * @param {EventTarget} element - event target\n * @param {string} eventType - event type\n * @param {Function} handler - event handler\n * @returns {ListenerData[]}\n */\n findAll(e, t, o) {\n let i;\n const s = e ? this.findByEventTarget(e) : [];\n return e && t && o ? i = s.filter((r) => r.eventType === t && r.handler === o) : e && t ? i = s.filter((r) => r.eventType === t) : i = s, i;\n }\n /**\n * Removes all listeners\n */\n removeAll() {\n this.allListeners.map((e) => {\n e.element.removeEventListener(e.eventType, e.handler, e.options);\n }), this.allListeners = [];\n }\n /**\n * Module cleanup on destruction\n */\n destroy() {\n this.removeAll();\n }\n /**\n * Search method: looks for listener by passed element\n *\n * @param {EventTarget} element - searching element\n * @returns {Array} listeners that found on element\n */\n findByEventTarget(e) {\n return this.allListeners.filter((t) => {\n if (t.element === e)\n return t;\n });\n }\n /**\n * Search method: looks for listener by passed event type\n *\n * @param {string} eventType - event type\n * @returns {ListenerData[]} listeners that found on element\n */\n findByType(e) {\n return this.allListeners.filter((t) => {\n if (t.eventType === e)\n return t;\n });\n }\n /**\n * Search method: looks for listener by passed handler\n *\n * @param {Function} handler - event handler\n * @returns {ListenerData[]} listeners that found on element\n */\n findByHandler(e) {\n return this.allListeners.filter((t) => {\n if (t.handler === e)\n return t;\n });\n }\n /**\n * Returns listener data found by id\n *\n * @param {string} id - listener identifier\n * @returns {ListenerData}\n */\n findById(e) {\n return this.allListeners.find((t) => t.id === e);\n }\n}\nclass E {\n /**\n * @class\n * @param options - Module options\n * @param options.config - Module config\n * @param options.eventsDispatcher - Common event bus\n */\n constructor({ config: e, eventsDispatcher: t }) {\n if (this.nodes = {}, this.listeners = new _e(), this.readOnlyMutableListeners = {\n /**\n * Assigns event listener on DOM element and pushes into special array that might be removed\n *\n * @param {EventTarget} element - DOM Element\n * @param {string} eventType - Event name\n * @param {Function} handler - Event handler\n * @param {boolean|AddEventListenerOptions} options - Listening options\n */\n on: (o, i, s, r = !1) => {\n this.mutableListenerIds.push(\n this.listeners.on(o, i, s, r)\n );\n },\n /**\n * Clears all mutable listeners\n */\n clearAll: () => {\n for (const o of this.mutableListenerIds)\n this.listeners.offById(o);\n this.mutableListenerIds = [];\n }\n }, this.mutableListenerIds = [], new.target === E)\n throw new TypeError(\"Constructors for abstract class Module are not allowed.\");\n this.config = e, this.eventsDispatcher = t;\n }\n /**\n * Editor modules setter\n *\n * @param {EditorModules} Editor - Editor's Modules\n */\n set state(e) {\n this.Editor = e;\n }\n /**\n * Remove memorized nodes\n */\n removeAllNodes() {\n for (const e in this.nodes) {\n const t = this.nodes[e];\n t instanceof HTMLElement && t.remove();\n }\n }\n /**\n * Returns true if current direction is RTL (Right-To-Left)\n */\n get isRtl() {\n return this.config.i18n.direction === \"rtl\";\n }\n}\nclass b {\n constructor() {\n this.instance = null, this.selection = null, this.savedSelectionRange = null, this.isFakeBackgroundEnabled = !1, this.commandBackground = \"backColor\", this.commandRemoveFormat = \"removeFormat\";\n }\n /**\n * Editor styles\n *\n * @returns {{editorWrapper: string, editorZone: string}}\n */\n static get CSS() {\n return {\n editorWrapper: \"codex-editor\",\n editorZone: \"codex-editor__redactor\"\n };\n }\n /**\n * Returns selected anchor\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode}\n *\n * @returns {Node|null}\n */\n static get anchorNode() {\n const e = window.getSelection();\n return e ? e.anchorNode : null;\n }\n /**\n * Returns selected anchor element\n *\n * @returns {Element|null}\n */\n static get anchorElement() {\n const e = window.getSelection();\n if (!e)\n return null;\n const t = e.anchorNode;\n return t ? d.isElement(t) ? t : t.parentElement : null;\n }\n /**\n * Returns selection offset according to the anchor node\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset}\n *\n * @returns {number|null}\n */\n static get anchorOffset() {\n const e = window.getSelection();\n return e ? e.anchorOffset : null;\n }\n /**\n * Is current selection range collapsed\n *\n * @returns {boolean|null}\n */\n static get isCollapsed() {\n const e = window.getSelection();\n return e ? e.isCollapsed : null;\n }\n /**\n * Check current selection if it is at Editor's zone\n *\n * @returns {boolean}\n */\n static get isAtEditor() {\n return this.isSelectionAtEditor(b.get());\n }\n /**\n * Check if passed selection is at Editor's zone\n *\n * @param selection - Selection object to check\n */\n static isSelectionAtEditor(e) {\n if (!e)\n return !1;\n let t = e.anchorNode || e.focusNode;\n t && t.nodeType === Node.TEXT_NODE && (t = t.parentNode);\n let o = null;\n return t && t instanceof Element && (o = t.closest(`.${b.CSS.editorZone}`)), o ? o.nodeType === Node.ELEMENT_NODE : !1;\n }\n /**\n * Check if passed range at Editor zone\n *\n * @param range - range to check\n */\n static isRangeAtEditor(e) {\n if (!e)\n return;\n let t = e.startContainer;\n t && t.nodeType === Node.TEXT_NODE && (t = t.parentNode);\n let o = null;\n return t && t instanceof Element && (o = t.closest(`.${b.CSS.editorZone}`)), o ? o.nodeType === Node.ELEMENT_NODE : !1;\n }\n /**\n * Methods return boolean that true if selection exists on the page\n */\n static get isSelectionExists() {\n return !!b.get().anchorNode;\n }\n /**\n * Return first range\n *\n * @returns {Range|null}\n */\n static get range() {\n return this.getRangeFromSelection(this.get());\n }\n /**\n * Returns range from passed Selection object\n *\n * @param selection - Selection object to get Range from\n */\n static getRangeFromSelection(e) {\n return e && e.rangeCount ? e.getRangeAt(0) : null;\n }\n /**\n * Calculates position and size of selected text\n *\n * @returns {DOMRect | ClientRect}\n */\n static get rect() {\n let e = document.selection, t, o = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n };\n if (e && e.type !== \"Control\")\n return e = e, t = e.createRange(), o.x = t.boundingLeft, o.y = t.boundingTop, o.width = t.boundingWidth, o.height = t.boundingHeight, o;\n if (!window.getSelection)\n return S(\"Method window.getSelection is not supported\", \"warn\"), o;\n if (e = window.getSelection(), e.rangeCount === null || isNaN(e.rangeCount))\n return S(\"Method SelectionUtils.rangeCount is not supported\", \"warn\"), o;\n if (e.rangeCount === 0)\n return o;\n if (t = e.getRangeAt(0).cloneRange(), t.getBoundingClientRect && (o = t.getBoundingClientRect()), o.x === 0 && o.y === 0) {\n const i = document.createElement(\"span\");\n if (i.getBoundingClientRect) {\n i.appendChild(document.createTextNode(\"\u200B\")), t.insertNode(i), o = i.getBoundingClientRect();\n const s = i.parentNode;\n s.removeChild(i), s.normalize();\n }\n }\n return o;\n }\n /**\n * Returns selected text as String\n *\n * @returns {string}\n */\n static get text() {\n return window.getSelection ? window.getSelection().toString() : \"\";\n }\n /**\n * Returns window SelectionUtils\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection}\n *\n * @returns {Selection}\n */\n static get() {\n return window.getSelection();\n }\n /**\n * Set focus to contenteditable or native input element\n *\n * @param element - element where to set focus\n * @param offset - offset of cursor\n */\n static setCursor(e, t = 0) {\n const o = document.createRange(), i = window.getSelection();\n return d.isNativeInput(e) ? d.canSetCaret(e) ? (e.focus(), e.selectionStart = e.selectionEnd = t, e.getBoundingClientRect()) : void 0 : (o.setStart(e, t), o.setEnd(e, t), i.removeAllRanges(), i.addRange(o), o.getBoundingClientRect());\n }\n /**\n * Check if current range exists and belongs to container\n *\n * @param container - where range should be\n */\n static isRangeInsideContainer(e) {\n const t = b.range;\n return t === null ? !1 : e.contains(t.startContainer);\n }\n /**\n * Adds fake cursor to the current range\n */\n static addFakeCursor() {\n const e = b.range;\n if (e === null)\n return;\n const t = d.make(\"span\", \"codex-editor__fake-cursor\");\n t.dataset.mutationFree = \"true\", e.collapse(), e.insertNode(t);\n }\n /**\n * Check if passed element contains a fake cursor\n *\n * @param el - where to check\n */\n static isFakeCursorInsideContainer(e) {\n return d.find(e, \".codex-editor__fake-cursor\") !== null;\n }\n /**\n * Removes fake cursor from a container\n *\n * @param container - container to look for\n */\n static removeFakeCursor(e = document.body) {\n const t = d.find(e, \".codex-editor__fake-cursor\");\n t && t.remove();\n }\n /**\n * Removes fake background\n */\n removeFakeBackground() {\n this.isFakeBackgroundEnabled && (this.isFakeBackgroundEnabled = !1, document.execCommand(this.commandRemoveFormat));\n }\n /**\n * Sets fake background\n */\n setFakeBackground() {\n document.execCommand(this.commandBackground, !1, \"#a8d6ff\"), this.isFakeBackgroundEnabled = !0;\n }\n /**\n * Save SelectionUtils's range\n */\n save() {\n this.savedSelectionRange = b.range;\n }\n /**\n * Restore saved SelectionUtils's range\n */\n restore() {\n if (!this.savedSelectionRange)\n return;\n const e = window.getSelection();\n e.removeAllRanges(), e.addRange(this.savedSelectionRange);\n }\n /**\n * Clears saved selection\n */\n clearSaved() {\n this.savedSelectionRange = null;\n }\n /**\n * Collapse current selection\n */\n collapseToEnd() {\n const e = window.getSelection(), t = document.createRange();\n t.selectNodeContents(e.focusNode), t.collapse(!1), e.removeAllRanges(), e.addRange(t);\n }\n /**\n * Looks ahead to find passed tag from current selection\n *\n * @param {string} tagName - tag to found\n * @param {string} [className] - tag's class name\n * @param {number} [searchDepth] - count of tags that can be included. For better performance.\n * @returns {HTMLElement|null}\n */\n findParentTag(e, t, o = 10) {\n const i = window.getSelection();\n let s = null;\n return !i || !i.anchorNode || !i.focusNode ? null : ([\n /** the Node in which the selection begins */\n i.anchorNode,\n /** the Node in which the selection ends */\n i.focusNode\n ].forEach((a) => {\n let l = o;\n for (; l > 0 && a.parentNode && !(a.tagName === e && (s = a, t && a.classList && !a.classList.contains(t) && (s = null), s)); )\n a = a.parentNode, l--;\n }), s);\n }\n /**\n * Expands selection range to the passed parent node\n *\n * @param {HTMLElement} element - element which contents should be selected\n */\n expandToTag(e) {\n const t = window.getSelection();\n t.removeAllRanges();\n const o = document.createRange();\n o.selectNodeContents(e), t.addRange(o);\n }\n}\nfunction pi(n, e) {\n const { type: t, target: o, addedNodes: i, removedNodes: s } = n;\n return n.type === \"attributes\" && n.attributeName === \"data-empty\" ? !1 : !!(e.contains(o) || t === \"childList\" && (Array.from(i).some((l) => l === e) || Array.from(s).some((l) => l === e)));\n}\nconst ft = \"redactor dom changed\", $o = \"block changed\", zo = \"fake cursor is about to be toggled\", Uo = \"fake cursor have been set\", Te = \"editor mobile layout toggled\";\nfunction gt(n, e) {\n if (!n.conversionConfig)\n return !1;\n const t = n.conversionConfig[e];\n return A(t) || te(t);\n}\nfunction He(n, e) {\n return gt(n.tool, e);\n}\nfunction Wo(n, e) {\n return Object.entries(n).some(([t, o]) => e[t] && ri(e[t], o));\n}\nasync function Yo(n, e) {\n const o = (await n.save()).data, i = e.find((s) => s.name === n.name);\n return i !== void 0 && !gt(i, \"export\") ? [] : e.reduce((s, r) => {\n if (!gt(r, \"import\") || r.toolbox === void 0)\n return s;\n const a = r.toolbox.filter((l) => {\n if (V(l) || l.icon === void 0)\n return !1;\n if (l.data !== void 0) {\n if (Wo(l.data, o))\n return !1;\n } else if (r.name === n.name)\n return !1;\n return !0;\n });\n return s.push({\n ...r,\n toolbox: a\n }), s;\n }, []);\n}\nfunction xo(n, e) {\n return n.mergeable ? n.name === e.name ? !0 : He(e, \"export\") && He(n, \"import\") : !1;\n}\nfunction fi(n, e) {\n const t = e == null ? void 0 : e.export;\n return A(t) ? t(n) : te(t) ? n[t] : (t !== void 0 && S(\"Conversion \u00ABexport\u00BB property must be a string or function. String means key of saved data object to export. Function should export processed string to export.\"), \"\");\n}\nfunction Bo(n, e, t) {\n const o = e == null ? void 0 : e.import;\n return A(o) ? o(n, t) : te(o) ? {\n [o]: n\n } : (o !== void 0 && S(\"Conversion \u00ABimport\u00BB property must be a string or function. String means key of tool data to import. Function accepts a imported string and return composed tool data.\"), {});\n}\nvar _ = /* @__PURE__ */ ((n) => (n.Default = \"default\", n.Separator = \"separator\", n.Html = \"html\", n))(_ || {}), ee = /* @__PURE__ */ ((n) => (n.APPEND_CALLBACK = \"appendCallback\", n.RENDERED = \"rendered\", n.MOVED = \"moved\", n.UPDATED = \"updated\", n.REMOVED = \"removed\", n.ON_PASTE = \"onPaste\", n))(ee || {});\nclass R extends Oe {\n /**\n * @param options - block constructor options\n * @param [options.id] - block's id. Will be generated if omitted.\n * @param options.data - Tool's initial data\n * @param options.tool \u2014 block's tool\n * @param options.api - Editor API module for pass it to the Block Tunes\n * @param options.readOnly - Read-Only flag\n * @param [eventBus] - Editor common event bus. Allows to subscribe on some Editor events. Could be omitted when \"virtual\" Block is created. See BlocksAPI@composeBlockData.\n */\n constructor({\n id: e = ni(),\n data: t,\n tool: o,\n readOnly: i,\n tunesData: s\n }, r) {\n super(), this.cachedInputs = [], this.toolRenderedElement = null, this.tunesInstances = /* @__PURE__ */ new Map(), this.defaultTunesInstances = /* @__PURE__ */ new Map(), this.unavailableTunesData = {}, this.inputIndex = 0, this.editorEventBus = null, this.handleFocus = () => {\n this.dropInputsCache(), this.updateCurrentInput();\n }, this.didMutated = (a = void 0) => {\n const l = a === void 0, c = a instanceof InputEvent;\n !l && !c && this.detectToolRootChange(a);\n let u;\n l || c ? u = !0 : u = !(a.length > 0 && a.every((p) => {\n const { addedNodes: g, removedNodes: f, target: v } = p;\n return [\n ...Array.from(g),\n ...Array.from(f),\n v\n ].some((T) => (d.isElement(T) || (T = T.parentElement), T && T.closest('[data-mutation-free=\"true\"]') !== null));\n })), u && (this.dropInputsCache(), this.updateCurrentInput(), this.toggleInputsEmptyMark(), this.call(\n \"updated\"\n /* UPDATED */\n ), this.emit(\"didMutated\", this));\n }, this.name = o.name, this.id = e, this.settings = o.settings, this.config = o.settings.config || {}, this.editorEventBus = r || null, this.blockAPI = new J(this), this.tool = o, this.toolInstance = o.create(t, this.blockAPI, i), this.tunes = o.tunes, this.composeTunes(s), this.holder = this.compose(), window.requestIdleCallback(() => {\n this.watchBlockMutations(), this.addInputEvents(), this.toggleInputsEmptyMark();\n });\n }\n /**\n * CSS classes for the Block\n *\n * @returns {{wrapper: string, content: string}}\n */\n static get CSS() {\n return {\n wrapper: \"ce-block\",\n wrapperStretched: \"ce-block--stretched\",\n content: \"ce-block__content\",\n selected: \"ce-block--selected\",\n dropTarget: \"ce-block--drop-target\"\n };\n }\n /**\n * Find and return all editable elements (contenteditable and native inputs) in the Tool HTML\n */\n get inputs() {\n if (this.cachedInputs.length !== 0)\n return this.cachedInputs;\n const e = d.findAllInputs(this.holder);\n return this.inputIndex > e.length - 1 && (this.inputIndex = e.length - 1), this.cachedInputs = e, e;\n }\n /**\n * Return current Tool`s input\n * If Block doesn't contain inputs, return undefined\n */\n get currentInput() {\n return this.inputs[this.inputIndex];\n }\n /**\n * Set input index to the passed element\n *\n * @param element - HTML Element to set as current input\n */\n set currentInput(e) {\n const t = this.inputs.findIndex((o) => o === e || o.contains(e));\n t !== -1 && (this.inputIndex = t);\n }\n /**\n * Return first Tool`s input\n * If Block doesn't contain inputs, return undefined\n */\n get firstInput() {\n return this.inputs[0];\n }\n /**\n * Return first Tool`s input\n * If Block doesn't contain inputs, return undefined\n */\n get lastInput() {\n const e = this.inputs;\n return e[e.length - 1];\n }\n /**\n * Return next Tool`s input or undefined if it doesn't exist\n * If Block doesn't contain inputs, return undefined\n */\n get nextInput() {\n return this.inputs[this.inputIndex + 1];\n }\n /**\n * Return previous Tool`s input or undefined if it doesn't exist\n * If Block doesn't contain inputs, return undefined\n */\n get previousInput() {\n return this.inputs[this.inputIndex - 1];\n }\n /**\n * Get Block's JSON data\n *\n * @returns {object}\n */\n get data() {\n return this.save().then((e) => e && !V(e.data) ? e.data : {});\n }\n /**\n * Returns tool's sanitizer config\n *\n * @returns {object}\n */\n get sanitize() {\n return this.tool.sanitizeConfig;\n }\n /**\n * is block mergeable\n * We plugin have merge function then we call it mergeable\n *\n * @returns {boolean}\n */\n get mergeable() {\n return A(this.toolInstance.merge);\n }\n /**\n * If Block contains inputs, it is focusable\n */\n get focusable() {\n return this.inputs.length !== 0;\n }\n /**\n * Check block for emptiness\n *\n * @returns {boolean}\n */\n get isEmpty() {\n const e = d.isEmpty(this.pluginsContent, \"/\"), t = !this.hasMedia;\n return e && t;\n }\n /**\n * Check if block has a media content such as images, iframe and other\n *\n * @returns {boolean}\n */\n get hasMedia() {\n const e = [\n \"img\",\n \"iframe\",\n \"video\",\n \"audio\",\n \"source\",\n \"input\",\n \"textarea\",\n \"twitterwidget\"\n ];\n return !!this.holder.querySelector(e.join(\",\"));\n }\n /**\n * Set selected state\n * We don't need to mark Block as Selected when it is empty\n *\n * @param {boolean} state - 'true' to select, 'false' to remove selection\n */\n set selected(e) {\n var i, s;\n this.holder.classList.toggle(R.CSS.selected, e);\n const t = e === !0 && b.isRangeInsideContainer(this.holder), o = e === !1 && b.isFakeCursorInsideContainer(this.holder);\n (t || o) && ((i = this.editorEventBus) == null || i.emit(zo, { state: e }), t ? b.addFakeCursor() : b.removeFakeCursor(this.holder), (s = this.editorEventBus) == null || s.emit(Uo, { state: e }));\n }\n /**\n * Returns True if it is Selected\n *\n * @returns {boolean}\n */\n get selected() {\n return this.holder.classList.contains(R.CSS.selected);\n }\n /**\n * Set stretched state\n *\n * @param {boolean} state - 'true' to enable, 'false' to disable stretched state\n */\n set stretched(e) {\n this.holder.classList.toggle(R.CSS.wrapperStretched, e);\n }\n /**\n * Return Block's stretched state\n *\n * @returns {boolean}\n */\n get stretched() {\n return this.holder.classList.contains(R.CSS.wrapperStretched);\n }\n /**\n * Toggle drop target state\n *\n * @param {boolean} state - 'true' if block is drop target, false otherwise\n */\n set dropTarget(e) {\n this.holder.classList.toggle(R.CSS.dropTarget, e);\n }\n /**\n * Returns Plugins content\n *\n * @returns {HTMLElement}\n */\n get pluginsContent() {\n return this.toolRenderedElement;\n }\n /**\n * Calls Tool's method\n *\n * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function\n *\n * @param {string} methodName - method to call\n * @param {object} params - method argument\n */\n call(e, t) {\n if (A(this.toolInstance[e])) {\n e === \"appendCallback\" && S(\n \"`appendCallback` hook is deprecated and will be removed in the next major release. Use `rendered` hook instead\",\n \"warn\"\n );\n try {\n this.toolInstance[e].call(this.toolInstance, t);\n } catch (o) {\n S(`Error during '${e}' call: ${o.message}`, \"error\");\n }\n }\n }\n /**\n * Call plugins merge method\n *\n * @param {BlockToolData} data - data to merge\n */\n async mergeWith(e) {\n await this.toolInstance.merge(e);\n }\n /**\n * Extracts data from Block\n * Groups Tool's save processing time\n *\n * @returns {object}\n */\n async save() {\n const e = await this.toolInstance.save(this.pluginsContent), t = this.unavailableTunesData;\n [\n ...this.tunesInstances.entries(),\n ...this.defaultTunesInstances.entries()\n ].forEach(([s, r]) => {\n if (A(r.save))\n try {\n t[s] = r.save();\n } catch (a) {\n S(`Tune ${r.constructor.name} save method throws an Error %o`, \"warn\", a);\n }\n });\n const o = window.performance.now();\n let i;\n return Promise.resolve(e).then((s) => (i = window.performance.now(), {\n id: this.id,\n tool: this.name,\n data: s,\n tunes: t,\n time: i - o\n })).catch((s) => {\n S(`Saving process for ${this.name} tool failed due to the ${s}`, \"log\", \"red\");\n });\n }\n /**\n * Uses Tool's validation method to check the correctness of output data\n * Tool's validation method is optional\n *\n * @description Method returns true|false whether data passed the validation or not\n * @param {BlockToolData} data - data to validate\n * @returns {Promise<boolean>} valid\n */\n async validate(e) {\n let t = !0;\n return this.toolInstance.validate instanceof Function && (t = await this.toolInstance.validate(e)), t;\n }\n /**\n * Returns data to render in Block Tunes menu.\n * Splits block tunes into 2 groups: block specific tunes and common tunes\n */\n getTunes() {\n const e = [], t = [], o = typeof this.toolInstance.renderSettings == \"function\" ? this.toolInstance.renderSettings() : [];\n return d.isElement(o) ? e.push({\n type: _.Html,\n element: o\n }) : Array.isArray(o) ? e.push(...o) : e.push(o), [\n ...this.tunesInstances.values(),\n ...this.defaultTunesInstances.values()\n ].map((s) => s.render()).forEach((s) => {\n d.isElement(s) ? t.push({\n type: _.Html,\n element: s\n }) : Array.isArray(s) ? t.push(...s) : t.push(s);\n }), {\n toolTunes: e,\n commonTunes: t\n };\n }\n /**\n * Update current input index with selection anchor node\n */\n updateCurrentInput() {\n this.currentInput = d.isNativeInput(document.activeElement) || !b.anchorNode ? document.activeElement : b.anchorNode;\n }\n /**\n * Allows to say Editor that Block was changed. Used to manually trigger Editor's 'onChange' callback\n * Can be useful for block changes invisible for editor core.\n */\n dispatchChange() {\n this.didMutated();\n }\n /**\n * Call Tool instance destroy method\n */\n destroy() {\n this.unwatchBlockMutations(), this.removeInputEvents(), super.destroy(), A(this.toolInstance.destroy) && this.toolInstance.destroy();\n }\n /**\n * Tool could specify several entries to be displayed at the Toolbox (for example, \"Heading 1\", \"Heading 2\", \"Heading 3\")\n * This method returns the entry that is related to the Block (depended on the Block data)\n */\n async getActiveToolboxEntry() {\n const e = this.tool.toolbox;\n if (e.length === 1)\n return Promise.resolve(this.tool.toolbox[0]);\n const t = await this.data, o = e;\n return o == null ? void 0 : o.find((i) => Wo(i.data, t));\n }\n /**\n * Exports Block data as string using conversion config\n */\n async exportDataAsString() {\n const e = await this.data;\n return fi(e, this.tool.conversionConfig);\n }\n /**\n * Make default Block wrappers and put Tool`s content there\n *\n * @returns {HTMLDivElement}\n */\n compose() {\n const e = d.make(\"div\", R.CSS.wrapper), t = d.make(\"div\", R.CSS.content), o = this.toolInstance.render();\n e.setAttribute(\"data-cy\", \"block-wrapper\"), e.dataset.id = this.id, this.toolRenderedElement = o, t.appendChild(this.toolRenderedElement);\n let i = t;\n return [...this.tunesInstances.values(), ...this.defaultTunesInstances.values()].forEach((s) => {\n if (A(s.wrap))\n try {\n i = s.wrap(i);\n } catch (r) {\n S(`Tune ${s.constructor.name} wrap method throws an Error %o`, \"warn\", r);\n }\n }), e.appendChild(i), e;\n }\n /**\n * Instantiate Block Tunes\n *\n * @param tunesData - current Block tunes data\n * @private\n */\n composeTunes(e) {\n Array.from(this.tunes.values()).forEach((t) => {\n (t.isInternal ? this.defaultTunesInstances : this.tunesInstances).set(t.name, t.create(e[t.name], this.blockAPI));\n }), Object.entries(e).forEach(([t, o]) => {\n this.tunesInstances.has(t) || (this.unavailableTunesData[t] = o);\n });\n }\n /**\n * Adds focus event listeners to all inputs and contenteditable\n */\n addInputEvents() {\n this.inputs.forEach((e) => {\n e.addEventListener(\"focus\", this.handleFocus), d.isNativeInput(e) && e.addEventListener(\"input\", this.didMutated);\n });\n }\n /**\n * removes focus event listeners from all inputs and contenteditable\n */\n removeInputEvents() {\n this.inputs.forEach((e) => {\n e.removeEventListener(\"focus\", this.handleFocus), d.isNativeInput(e) && e.removeEventListener(\"input\", this.didMutated);\n });\n }\n /**\n * Listen common editor Dom Changed event and detect mutations related to the Block\n */\n watchBlockMutations() {\n var e;\n this.redactorDomChangedCallback = (t) => {\n const { mutations: o } = t;\n o.some((s) => pi(s, this.toolRenderedElement)) && this.didMutated(o);\n }, (e = this.editorEventBus) == null || e.on(ft, this.redactorDomChangedCallback);\n }\n /**\n * Remove redactor dom change event listener\n */\n unwatchBlockMutations() {\n var e;\n (e = this.editorEventBus) == null || e.off(ft, this.redactorDomChangedCallback);\n }\n /**\n * Sometimes Tool can replace own main element, for example H2 -> H4 or UL -> OL\n * We need to detect such changes and update a link to tools main element with the new one\n *\n * @param mutations - records of block content mutations\n */\n detectToolRootChange(e) {\n e.forEach((t) => {\n if (Array.from(t.removedNodes).includes(this.toolRenderedElement)) {\n const i = t.addedNodes[t.addedNodes.length - 1];\n this.toolRenderedElement = i;\n }\n });\n }\n /**\n * Clears inputs cached value\n */\n dropInputsCache() {\n this.cachedInputs = [];\n }\n /**\n * Mark inputs with 'data-empty' attribute with the empty state\n */\n toggleInputsEmptyMark() {\n this.inputs.forEach(Do);\n }\n}\nclass gi extends E {\n constructor() {\n super(...arguments), this.insert = (e = this.config.defaultBlock, t = {}, o = {}, i, s, r, a) => {\n const l = this.Editor.BlockManager.insert({\n id: a,\n tool: e,\n data: t,\n index: i,\n needToFocus: s,\n replace: r\n });\n return new J(l);\n }, this.composeBlockData = async (e) => {\n const t = this.Editor.Tools.blockTools.get(e);\n return new R({\n tool: t,\n api: this.Editor.API,\n readOnly: !0,\n data: {},\n tunesData: {}\n }).data;\n }, this.update = async (e, t, o) => {\n const { BlockManager: i } = this.Editor, s = i.getBlockById(e);\n if (s === void 0)\n throw new Error(`Block with id \"${e}\" not found`);\n const r = await i.update(s, t, o);\n return new J(r);\n }, this.convert = async (e, t, o) => {\n var h, p;\n const { BlockManager: i, Tools: s } = this.Editor, r = i.getBlockById(e);\n if (!r)\n throw new Error(`Block with id \"${e}\" not found`);\n const a = s.blockTools.get(r.name), l = s.blockTools.get(t);\n if (!l)\n throw new Error(`Block Tool with type \"${t}\" not found`);\n const c = ((h = a == null ? void 0 : a.conversionConfig) == null ? void 0 : h.export) !== void 0, u = ((p = l.conversionConfig) == null ? void 0 : p.import) !== void 0;\n if (c && u) {\n const g = await i.convert(r, t, o);\n return new J(g);\n } else {\n const g = [\n c ? !1 : je(r.name),\n u ? !1 : je(t)\n ].filter(Boolean).join(\" and \");\n throw new Error(`Conversion from \"${r.name}\" to \"${t}\" is not possible. ${g} tool(s) should provide a \"conversionConfig\"`);\n }\n }, this.insertMany = (e, t = this.Editor.BlockManager.blocks.length - 1) => {\n this.validateIndex(t);\n const o = e.map(({ id: i, type: s, data: r }) => this.Editor.BlockManager.composeBlock({\n id: i,\n tool: s || this.config.defaultBlock,\n data: r\n }));\n return this.Editor.BlockManager.insertMany(o, t), o.map((i) => new J(i));\n };\n }\n /**\n * Available methods\n *\n * @returns {Blocks}\n */\n get methods() {\n return {\n clear: () => this.clear(),\n render: (e) => this.render(e),\n renderFromHTML: (e) => this.renderFromHTML(e),\n delete: (e) => this.delete(e),\n swap: (e, t) => this.swap(e, t),\n move: (e, t) => this.move(e, t),\n getBlockByIndex: (e) => this.getBlockByIndex(e),\n getById: (e) => this.getById(e),\n getCurrentBlockIndex: () => this.getCurrentBlockIndex(),\n getBlockIndex: (e) => this.getBlockIndex(e),\n getBlocksCount: () => this.getBlocksCount(),\n getBlockByElement: (e) => this.getBlockByElement(e),\n stretchBlock: (e, t = !0) => this.stretchBlock(e, t),\n insertNewBlock: () => this.insertNewBlock(),\n insert: this.insert,\n insertMany: this.insertMany,\n update: this.update,\n composeBlockData: this.composeBlockData,\n convert: this.convert\n };\n }\n /**\n * Returns Blocks count\n *\n * @returns {number}\n */\n getBlocksCount() {\n return this.Editor.BlockManager.blocks.length;\n }\n /**\n * Returns current block index\n *\n * @returns {number}\n */\n getCurrentBlockIndex() {\n return this.Editor.BlockManager.currentBlockIndex;\n }\n /**\n * Returns the index of Block by id;\n *\n * @param id - block id\n */\n getBlockIndex(e) {\n const t = this.Editor.BlockManager.getBlockById(e);\n if (!t) {\n X(\"There is no block with id `\" + e + \"`\", \"warn\");\n return;\n }\n return this.Editor.BlockManager.getBlockIndex(t);\n }\n /**\n * Returns BlockAPI object by Block index\n *\n * @param {number} index - index to get\n */\n getBlockByIndex(e) {\n const t = this.Editor.BlockManager.getBlockByIndex(e);\n if (t === void 0) {\n X(\"There is no block at index `\" + e + \"`\", \"warn\");\n return;\n }\n return new J(t);\n }\n /**\n * Returns BlockAPI object by Block id\n *\n * @param id - id of block to get\n */\n getById(e) {\n const t = this.Editor.BlockManager.getBlockById(e);\n return t === void 0 ? (X(\"There is no block with id `\" + e + \"`\", \"warn\"), null) : new J(t);\n }\n /**\n * Get Block API object by any child html element\n *\n * @param element - html element to get Block by\n */\n getBlockByElement(e) {\n const t = this.Editor.BlockManager.getBlock(e);\n if (t === void 0) {\n X(\"There is no block corresponding to element `\" + e + \"`\", \"warn\");\n return;\n }\n return new J(t);\n }\n /**\n * Call Block Manager method that swap Blocks\n *\n * @param {number} fromIndex - position of first Block\n * @param {number} toIndex - position of second Block\n * @deprecated \u2014 use 'move' instead\n */\n swap(e, t) {\n S(\n \"`blocks.swap()` method is deprecated and will be removed in the next major release. Use `block.move()` method instead\",\n \"info\"\n ), this.Editor.BlockManager.swap(e, t);\n }\n /**\n * Move block from one index to another\n *\n * @param {number} toIndex - index to move to\n * @param {number} fromIndex - index to move from\n */\n move(e, t) {\n this.Editor.BlockManager.move(e, t);\n }\n /**\n * Deletes Block\n *\n * @param {number} blockIndex - index of Block to delete\n */\n delete(e = this.Editor.BlockManager.currentBlockIndex) {\n try {\n const t = this.Editor.BlockManager.getBlockByIndex(e);\n this.Editor.BlockManager.removeBlock(t);\n } catch (t) {\n X(t, \"warn\");\n return;\n }\n this.Editor.BlockManager.blocks.length === 0 && this.Editor.BlockManager.insert(), this.Editor.BlockManager.currentBlock && this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock, this.Editor.Caret.positions.END), this.Editor.Toolbar.close();\n }\n /**\n * Clear Editor's area\n */\n async clear() {\n await this.Editor.BlockManager.clear(!0), this.Editor.InlineToolbar.close();\n }\n /**\n * Fills Editor with Blocks data\n *\n * @param {OutputData} data \u2014 Saved Editor data\n */\n async render(e) {\n if (e === void 0 || e.blocks === void 0)\n throw new Error(\"Incorrect data passed to the render() method\");\n this.Editor.ModificationsObserver.disable(), await this.Editor.BlockManager.clear(), await this.Editor.Renderer.render(e.blocks), this.Editor.ModificationsObserver.enable();\n }\n /**\n * Render passed HTML string\n *\n * @param {string} data - HTML string to render\n * @returns {Promise<void>}\n */\n renderFromHTML(e) {\n return this.Editor.BlockManager.clear(), this.Editor.Paste.processText(e, !0);\n }\n /**\n * Stretch Block's content\n *\n * @param {number} index - index of Block to stretch\n * @param {boolean} status - true to enable, false to disable\n * @deprecated Use BlockAPI interface to stretch Blocks\n */\n stretchBlock(e, t = !0) {\n ht(\n !0,\n \"blocks.stretchBlock()\",\n \"BlockAPI\"\n );\n const o = this.Editor.BlockManager.getBlockByIndex(e);\n o && (o.stretched = t);\n }\n /**\n * Insert new Block\n * After set caret to this Block\n *\n * @todo remove in 3.0.0\n * @deprecated with insert() method\n */\n insertNewBlock() {\n S(\"Method blocks.insertNewBlock() is deprecated and it will be removed in the next major release. Use blocks.insert() instead.\", \"warn\"), this.insert();\n }\n /**\n * Validated block index and throws an error if it's invalid\n *\n * @param index - index to validate\n */\n validateIndex(e) {\n if (typeof e != \"number\")\n throw new Error(\"Index should be a number\");\n if (e < 0)\n throw new Error(\"Index should be greater than or equal to 0\");\n if (e === null)\n throw new Error(\"Index should be greater than or equal to 0\");\n }\n}\nfunction mi(n, e) {\n return typeof n == \"number\" ? e.BlockManager.getBlockByIndex(n) : typeof n == \"string\" ? e.BlockManager.getBlockById(n) : e.BlockManager.getBlockById(n.id);\n}\nclass bi extends E {\n constructor() {\n super(...arguments), this.setToFirstBlock = (e = this.Editor.Caret.positions.DEFAULT, t = 0) => this.Editor.BlockManager.firstBlock ? (this.Editor.Caret.setToBlock(this.Editor.BlockManager.firstBlock, e, t), !0) : !1, this.setToLastBlock = (e = this.Editor.Caret.positions.DEFAULT, t = 0) => this.Editor.BlockManager.lastBlock ? (this.Editor.Caret.setToBlock(this.Editor.BlockManager.lastBlock, e, t), !0) : !1, this.setToPreviousBlock = (e = this.Editor.Caret.positions.DEFAULT, t = 0) => this.Editor.BlockManager.previousBlock ? (this.Editor.Caret.setToBlock(this.Editor.BlockManager.previousBlock, e, t), !0) : !1, this.setToNextBlock = (e = this.Editor.Caret.positions.DEFAULT, t = 0) => this.Editor.BlockManager.nextBlock ? (this.Editor.Caret.setToBlock(this.Editor.BlockManager.nextBlock, e, t), !0) : !1, this.setToBlock = (e, t = this.Editor.Caret.positions.DEFAULT, o = 0) => {\n const i = mi(e, this.Editor);\n return i === void 0 ? !1 : (this.Editor.Caret.setToBlock(i, t, o), !0);\n }, this.focus = (e = !1) => e ? this.setToLastBlock(this.Editor.Caret.positions.END) : this.setToFirstBlock(this.Editor.Caret.positions.START);\n }\n /**\n * Available methods\n *\n * @returns {Caret}\n */\n get methods() {\n return {\n setToFirstBlock: this.setToFirstBlock,\n setToLastBlock: this.setToLastBlock,\n setToPreviousBlock: this.setToPreviousBlock,\n setToNextBlock: this.setToNextBlock,\n setToBlock: this.setToBlock,\n focus: this.focus\n };\n }\n}\nclass vi extends E {\n /**\n * Available methods\n *\n * @returns {Events}\n */\n get methods() {\n return {\n emit: (e, t) => this.emit(e, t),\n off: (e, t) => this.off(e, t),\n on: (e, t) => this.on(e, t)\n };\n }\n /**\n * Subscribe on Events\n *\n * @param {string} eventName - event name to subscribe\n * @param {Function} callback - event handler\n */\n on(e, t) {\n this.eventsDispatcher.on(e, t);\n }\n /**\n * Emit event with data\n *\n * @param {string} eventName - event to emit\n * @param {object} data - event's data\n */\n emit(e, t) {\n this.eventsDispatcher.emit(e, t);\n }\n /**\n * Unsubscribe from Event\n *\n * @param {string} eventName - event to unsubscribe\n * @param {Function} callback - event handler\n */\n off(e, t) {\n this.eventsDispatcher.off(e, t);\n }\n}\nclass kt extends E {\n /**\n * Return namespace section for tool or block tune\n *\n * @param toolName - tool name\n * @param isTune - is tool a block tune\n */\n static getNamespace(e, t) {\n return t ? `blockTunes.${e}` : `tools.${e}`;\n }\n /**\n * Return I18n API methods with global dictionary access\n */\n get methods() {\n return {\n t: () => {\n X(\"I18n.t() method can be accessed only from Tools\", \"warn\");\n }\n };\n }\n /**\n * Return I18n API methods with tool namespaced dictionary\n *\n * @param toolName - tool name\n * @param isTune - is tool a block tune\n */\n getMethodsForTool(e, t) {\n return Object.assign(\n this.methods,\n {\n t: (o) => z.t(kt.getNamespace(e, t), o)\n }\n );\n }\n}\nclass ki extends E {\n /**\n * Editor.js Core API modules\n */\n get methods() {\n return {\n blocks: this.Editor.BlocksAPI.methods,\n caret: this.Editor.CaretAPI.methods,\n tools: this.Editor.ToolsAPI.methods,\n events: this.Editor.EventsAPI.methods,\n listeners: this.Editor.ListenersAPI.methods,\n notifier: this.Editor.NotifierAPI.methods,\n sanitizer: this.Editor.SanitizerAPI.methods,\n saver: this.Editor.SaverAPI.methods,\n selection: this.Editor.SelectionAPI.methods,\n styles: this.Editor.StylesAPI.classes,\n toolbar: this.Editor.ToolbarAPI.methods,\n inlineToolbar: this.Editor.InlineToolbarAPI.methods,\n tooltip: this.Editor.TooltipAPI.methods,\n i18n: this.Editor.I18nAPI.methods,\n readOnly: this.Editor.ReadOnlyAPI.methods,\n ui: this.Editor.UiAPI.methods\n };\n }\n /**\n * Returns Editor.js Core API methods for passed tool\n *\n * @param toolName - tool name\n * @param isTune - is tool a block tune\n */\n getMethodsForTool(e, t) {\n return Object.assign(\n this.methods,\n {\n i18n: this.Editor.I18nAPI.getMethodsForTool(e, t)\n }\n );\n }\n}\nclass yi extends E {\n /**\n * Available methods\n *\n * @returns {InlineToolbar}\n */\n get methods() {\n return {\n close: () => this.close(),\n open: () => this.open()\n };\n }\n /**\n * Open Inline Toolbar\n */\n open() {\n this.Editor.InlineToolbar.tryToShow();\n }\n /**\n * Close Inline Toolbar\n */\n close() {\n this.Editor.InlineToolbar.close();\n }\n}\nclass wi extends E {\n /**\n * Available methods\n *\n * @returns {Listeners}\n */\n get methods() {\n return {\n on: (e, t, o, i) => this.on(e, t, o, i),\n off: (e, t, o, i) => this.off(e, t, o, i),\n offById: (e) => this.offById(e)\n };\n }\n /**\n * Ads a DOM event listener. Return it's id.\n *\n * @param {HTMLElement} element - Element to set handler to\n * @param {string} eventType - event type\n * @param {() => void} handler - event handler\n * @param {boolean} useCapture - capture event or not\n */\n on(e, t, o, i) {\n return this.listeners.on(e, t, o, i);\n }\n /**\n * Removes DOM listener from element\n *\n * @param {Element} element - Element to remove handler from\n * @param eventType - event type\n * @param handler - event handler\n * @param {boolean} useCapture - capture event or not\n */\n off(e, t, o, i) {\n this.listeners.off(e, t, o, i);\n }\n /**\n * Removes DOM listener by the listener id\n *\n * @param id - id of the listener to remove\n */\n offById(e) {\n this.listeners.offById(e);\n }\n}\nvar Ko = { exports: {} };\n(function(n, e) {\n (function(t, o) {\n n.exports = o();\n })(window, function() {\n return function(t) {\n var o = {};\n function i(s) {\n if (o[s])\n return o[s].exports;\n var r = o[s] = { i: s, l: !1, exports: {} };\n return t[s].call(r.exports, r, r.exports, i), r.l = !0, r.exports;\n }\n return i.m = t, i.c = o, i.d = function(s, r, a) {\n i.o(s, r) || Object.defineProperty(s, r, { enumerable: !0, get: a });\n }, i.r = function(s) {\n typeof Symbol < \"u\" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: \"Module\" }), Object.defineProperty(s, \"__esModule\", { value: !0 });\n }, i.t = function(s, r) {\n if (1 & r && (s = i(s)), 8 & r || 4 & r && typeof s == \"object\" && s && s.__esModule)\n return s;\n var a = /* @__PURE__ */ Object.create(null);\n if (i.r(a), Object.defineProperty(a, \"default\", { enumerable: !0, value: s }), 2 & r && typeof s != \"string\")\n for (var l in s)\n i.d(a, l, (function(c) {\n return s[c];\n }).bind(null, l));\n return a;\n }, i.n = function(s) {\n var r = s && s.__esModule ? function() {\n return s.default;\n } : function() {\n return s;\n };\n return i.d(r, \"a\", r), r;\n }, i.o = function(s, r) {\n return Object.prototype.hasOwnProperty.call(s, r);\n }, i.p = \"/\", i(i.s = 0);\n }([function(t, o, i) {\n i(1), /*!\n * Codex JavaScript Notification module\n * https://github.com/codex-team/js-notifier\n */\n t.exports = function() {\n var s = i(6), r = \"cdx-notify--bounce-in\", a = null;\n return { show: function(l) {\n if (l.message) {\n (function() {\n if (a)\n return !0;\n a = s.getWrapper(), document.body.appendChild(a);\n })();\n var c = null, u = l.time || 8e3;\n switch (l.type) {\n case \"confirm\":\n c = s.confirm(l);\n break;\n case \"prompt\":\n c = s.prompt(l);\n break;\n default:\n c = s.alert(l), window.setTimeout(function() {\n c.remove();\n }, u);\n }\n a.appendChild(c), c.classList.add(r);\n }\n } };\n }();\n }, function(t, o, i) {\n var s = i(2);\n typeof s == \"string\" && (s = [[t.i, s, \"\"]]);\n var r = { hmr: !0, transform: void 0, insertInto: void 0 };\n i(4)(s, r), s.locals && (t.exports = s.locals);\n }, function(t, o, i) {\n (t.exports = i(3)(!1)).push([t.i, `.cdx-notify--error{background:#fffbfb!important}.cdx-notify--error::before{background:#fb5d5d!important}.cdx-notify__input{max-width:130px;padding:5px 10px;background:#f7f7f7;border:0;border-radius:3px;font-size:13px;color:#656b7c;outline:0}.cdx-notify__input:-ms-input-placeholder{color:#656b7c}.cdx-notify__input::placeholder{color:#656b7c}.cdx-notify__input:focus:-ms-input-placeholder{color:rgba(101,107,124,.3)}.cdx-notify__input:focus::placeholder{color:rgba(101,107,124,.3)}.cdx-notify__button{border:none;border-radius:3px;font-size:13px;padding:5px 10px;cursor:pointer}.cdx-notify__button:last-child{margin-left:10px}.cdx-notify__button--cancel{background:#f2f5f7;box-shadow:0 2px 1px 0 rgba(16,19,29,0);color:#656b7c}.cdx-notify__button--cancel:hover{background:#eee}.cdx-notify__button--confirm{background:#34c992;box-shadow:0 1px 1px 0 rgba(18,49,35,.05);color:#fff}.cdx-notify__button--confirm:hover{background:#33b082}.cdx-notify__btns-wrapper{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;margin-top:5px}.cdx-notify__cross{position:absolute;top:5px;right:5px;width:10px;height:10px;padding:5px;opacity:.54;cursor:pointer}.cdx-notify__cross::after,.cdx-notify__cross::before{content:'';position:absolute;left:9px;top:5px;height:12px;width:2px;background:#575d67}.cdx-notify__cross::before{transform:rotate(-45deg)}.cdx-notify__cross::after{transform:rotate(45deg)}.cdx-notify__cross:hover{opacity:1}.cdx-notifies{position:fixed;z-index:2;bottom:20px;left:20px;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen,Ubuntu,Cantarell,\"Fira Sans\",\"Droid Sans\",\"Helvetica Neue\",sans-serif}.cdx-notify{position:relative;width:220px;margin-top:15px;padding:13px 16px;background:#fff;box-shadow:0 11px 17px 0 rgba(23,32,61,.13);border-radius:5px;font-size:14px;line-height:1.4em;word-wrap:break-word}.cdx-notify::before{content:'';position:absolute;display:block;top:0;left:0;width:3px;height:calc(100% - 6px);margin:3px;border-radius:5px;background:0 0}@keyframes bounceIn{0%{opacity:0;transform:scale(.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(.9)}100%{transform:scale(1)}}.cdx-notify--bounce-in{animation-name:bounceIn;animation-duration:.6s;animation-iteration-count:1}.cdx-notify--success{background:#fafffe!important}.cdx-notify--success::before{background:#41ffb1!important}`, \"\"]);\n }, function(t, o) {\n t.exports = function(i) {\n var s = [];\n return s.toString = function() {\n return this.map(function(r) {\n var a = function(l, c) {\n var u = l[1] || \"\", h = l[3];\n if (!h)\n return u;\n if (c && typeof btoa == \"function\") {\n var p = (f = h, \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(f)))) + \" */\"), g = h.sources.map(function(v) {\n return \"/*# sourceURL=\" + h.sourceRoot + v + \" */\";\n });\n return [u].concat(g).concat([p]).join(`\n`);\n }\n var f;\n return [u].join(`\n`);\n }(r, i);\n return r[2] ? \"@media \" + r[2] + \"{\" + a + \"}\" : a;\n }).join(\"\");\n }, s.i = function(r, a) {\n typeof r == \"string\" && (r = [[null, r, \"\"]]);\n for (var l = {}, c = 0; c < this.length; c++) {\n var u = this[c][0];\n typeof u == \"number\" && (l[u] = !0);\n }\n for (c = 0; c < r.length; c++) {\n var h = r[c];\n typeof h[0] == \"number\" && l[h[0]] || (a && !h[2] ? h[2] = a : a && (h[2] = \"(\" + h[2] + \") and (\" + a + \")\"), s.push(h));\n }\n }, s;\n };\n }, function(t, o, i) {\n var s, r, a = {}, l = (s = function() {\n return window && document && document.all && !window.atob;\n }, function() {\n return r === void 0 && (r = s.apply(this, arguments)), r;\n }), c = function(k) {\n var m = {};\n return function(w) {\n if (typeof w == \"function\")\n return w();\n if (m[w] === void 0) {\n var x = (function(I) {\n return document.querySelector(I);\n }).call(this, w);\n if (window.HTMLIFrameElement && x instanceof window.HTMLIFrameElement)\n try {\n x = x.contentDocument.head;\n } catch {\n x = null;\n }\n m[w] = x;\n }\n return m[w];\n };\n }(), u = null, h = 0, p = [], g = i(5);\n function f(k, m) {\n for (var w = 0; w < k.length; w++) {\n var x = k[w], I = a[x.id];\n if (I) {\n I.refs++;\n for (var C = 0; C < I.parts.length; C++)\n I.parts[C](x.parts[C]);\n for (; C < x.parts.length; C++)\n I.parts.push(F(x.parts[C], m));\n } else {\n var N = [];\n for (C = 0; C < x.parts.length; C++)\n N.push(F(x.parts[C], m));\n a[x.id] = { id: x.id, refs: 1, parts: N };\n }\n }\n }\n function v(k, m) {\n for (var w = [], x = {}, I = 0; I < k.length; I++) {\n var C = k[I], N = m.base ? C[0] + m.base : C[0], B = { css: C[1], media: C[2], sourceMap: C[3] };\n x[N] ? x[N].parts.push(B) : w.push(x[N] = { id: N, parts: [B] });\n }\n return w;\n }\n function O(k, m) {\n var w = c(k.insertInto);\n if (!w)\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n var x = p[p.length - 1];\n if (k.insertAt === \"top\")\n x ? x.nextSibling ? w.insertBefore(m, x.nextSibling) : w.appendChild(m) : w.insertBefore(m, w.firstChild), p.push(m);\n else if (k.insertAt === \"bottom\")\n w.appendChild(m);\n else {\n if (typeof k.insertAt != \"object\" || !k.insertAt.before)\n throw new Error(`[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n`);\n var I = c(k.insertInto + \" \" + k.insertAt.before);\n w.insertBefore(m, I);\n }\n }\n function T(k) {\n if (k.parentNode === null)\n return !1;\n k.parentNode.removeChild(k);\n var m = p.indexOf(k);\n m >= 0 && p.splice(m, 1);\n }\n function M(k) {\n var m = document.createElement(\"style\");\n return k.attrs.type === void 0 && (k.attrs.type = \"text/css\"), q(m, k.attrs), O(k, m), m;\n }\n function q(k, m) {\n Object.keys(m).forEach(function(w) {\n k.setAttribute(w, m[w]);\n });\n }\n function F(k, m) {\n var w, x, I, C;\n if (m.transform && k.css) {\n if (!(C = m.transform(k.css)))\n return function() {\n };\n k.css = C;\n }\n if (m.singleton) {\n var N = h++;\n w = u || (u = M(m)), x = ie.bind(null, w, N, !1), I = ie.bind(null, w, N, !0);\n } else\n k.sourceMap && typeof URL == \"function\" && typeof URL.createObjectURL == \"function\" && typeof URL.revokeObjectURL == \"function\" && typeof Blob == \"function\" && typeof btoa == \"function\" ? (w = function(B) {\n var W = document.createElement(\"link\");\n return B.attrs.type === void 0 && (B.attrs.type = \"text/css\"), B.attrs.rel = \"stylesheet\", q(W, B.attrs), O(B, W), W;\n }(m), x = (function(B, W, ve) {\n var se = ve.css, tt = ve.sourceMap, Yn = W.convertToAbsoluteUrls === void 0 && tt;\n (W.convertToAbsoluteUrls || Yn) && (se = g(se)), tt && (se += `\n/*# sourceMappingURL=data:application/json;base64,` + btoa(unescape(encodeURIComponent(JSON.stringify(tt)))) + \" */\");\n var Kn = new Blob([se], { type: \"text/css\" }), ko = B.href;\n B.href = URL.createObjectURL(Kn), ko && URL.revokeObjectURL(ko);\n }).bind(null, w, m), I = function() {\n T(w), w.href && URL.revokeObjectURL(w.href);\n }) : (w = M(m), x = (function(B, W) {\n var ve = W.css, se = W.media;\n if (se && B.setAttribute(\"media\", se), B.styleSheet)\n B.styleSheet.cssText = ve;\n else {\n for (; B.firstChild; )\n B.removeChild(B.firstChild);\n B.appendChild(document.createTextNode(ve));\n }\n }).bind(null, w), I = function() {\n T(w);\n });\n return x(k), function(B) {\n if (B) {\n if (B.css === k.css && B.media === k.media && B.sourceMap === k.sourceMap)\n return;\n x(k = B);\n } else\n I();\n };\n }\n t.exports = function(k, m) {\n if (typeof DEBUG < \"u\" && DEBUG && typeof document != \"object\")\n throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n (m = m || {}).attrs = typeof m.attrs == \"object\" ? m.attrs : {}, m.singleton || typeof m.singleton == \"boolean\" || (m.singleton = l()), m.insertInto || (m.insertInto = \"head\"), m.insertAt || (m.insertAt = \"bottom\");\n var w = v(k, m);\n return f(w, m), function(x) {\n for (var I = [], C = 0; C < w.length; C++) {\n var N = w[C];\n (B = a[N.id]).refs--, I.push(B);\n }\n for (x && f(v(x, m), m), C = 0; C < I.length; C++) {\n var B;\n if ((B = I[C]).refs === 0) {\n for (var W = 0; W < B.parts.length; W++)\n B.parts[W]();\n delete a[B.id];\n }\n }\n };\n };\n var H, Q = (H = [], function(k, m) {\n return H[k] = m, H.filter(Boolean).join(`\n`);\n });\n function ie(k, m, w, x) {\n var I = w ? \"\" : x.css;\n if (k.styleSheet)\n k.styleSheet.cssText = Q(m, I);\n else {\n var C = document.createTextNode(I), N = k.childNodes;\n N[m] && k.removeChild(N[m]), N.length ? k.insertBefore(C, N[m]) : k.appendChild(C);\n }\n }\n }, function(t, o) {\n t.exports = function(i) {\n var s = typeof window < \"u\" && window.location;\n if (!s)\n throw new Error(\"fixUrls requires window.location\");\n if (!i || typeof i != \"string\")\n return i;\n var r = s.protocol + \"//\" + s.host, a = r + s.pathname.replace(/\\/[^\\/]*$/, \"/\");\n return i.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(l, c) {\n var u, h = c.trim().replace(/^\"(.*)\"$/, function(p, g) {\n return g;\n }).replace(/^'(.*)'$/, function(p, g) {\n return g;\n });\n return /^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/|\\s*$)/i.test(h) ? l : (u = h.indexOf(\"//\") === 0 ? h : h.indexOf(\"/\") === 0 ? r + h : a + h.replace(/^\\.\\//, \"\"), \"url(\" + JSON.stringify(u) + \")\");\n });\n };\n }, function(t, o, i) {\n var s, r, a, l, c, u, h, p, g;\n t.exports = (s = \"cdx-notifies\", r = \"cdx-notify\", a = \"cdx-notify__cross\", l = \"cdx-notify__button--confirm\", c = \"cdx-notify__button--cancel\", u = \"cdx-notify__input\", h = \"cdx-notify__button\", p = \"cdx-notify__btns-wrapper\", { alert: g = function(f) {\n var v = document.createElement(\"DIV\"), O = document.createElement(\"DIV\"), T = f.message, M = f.style;\n return v.classList.add(r), M && v.classList.add(r + \"--\" + M), v.innerHTML = T, O.classList.add(a), O.addEventListener(\"click\", v.remove.bind(v)), v.appendChild(O), v;\n }, confirm: function(f) {\n var v = g(f), O = document.createElement(\"div\"), T = document.createElement(\"button\"), M = document.createElement(\"button\"), q = v.querySelector(\".\" + a), F = f.cancelHandler, H = f.okHandler;\n return O.classList.add(p), T.innerHTML = f.okText || \"Confirm\", M.innerHTML = f.cancelText || \"Cancel\", T.classList.add(h), M.classList.add(h), T.classList.add(l), M.classList.add(c), F && typeof F == \"function\" && (M.addEventListener(\"click\", F), q.addEventListener(\"click\", F)), H && typeof H == \"function\" && T.addEventListener(\"click\", H), T.addEventListener(\"click\", v.remove.bind(v)), M.addEventListener(\"click\", v.remove.bind(v)), O.appendChild(T), O.appendChild(M), v.appendChild(O), v;\n }, prompt: function(f) {\n var v = g(f), O = document.createElement(\"div\"), T = document.createElement(\"button\"), M = document.createElement(\"input\"), q = v.querySelector(\".\" + a), F = f.cancelHandler, H = f.okHandler;\n return O.classList.add(p), T.innerHTML = f.okText || \"Ok\", T.classList.add(h), T.classList.add(l), M.classList.add(u), f.placeholder && M.setAttribute(\"placeholder\", f.placeholder), f.default && (M.value = f.default), f.inputType && (M.type = f.inputType), F && typeof F == \"function\" && q.addEventListener(\"click\", F), H && typeof H == \"function\" && T.addEventListener(\"click\", function() {\n H(M.value);\n }), T.addEventListener(\"click\", v.remove.bind(v)), O.appendChild(M), O.appendChild(T), v.appendChild(O), v;\n }, getWrapper: function() {\n var f = document.createElement(\"DIV\");\n return f.classList.add(s), f;\n } });\n }]);\n });\n})(Ko);\nvar Ei = Ko.exports;\nconst xi = /* @__PURE__ */ Ke(Ei);\nclass Bi {\n /**\n * Show web notification\n *\n * @param {NotifierOptions | ConfirmNotifierOptions | PromptNotifierOptions} options - notification options\n */\n show(e) {\n xi.show(e);\n }\n}\nclass Ci extends E {\n /**\n * @param moduleConfiguration - Module Configuration\n * @param moduleConfiguration.config - Editor's config\n * @param moduleConfiguration.eventsDispatcher - Editor's event dispatcher\n */\n constructor({ config: e, eventsDispatcher: t }) {\n super({\n config: e,\n eventsDispatcher: t\n }), this.notifier = new Bi();\n }\n /**\n * Available methods\n */\n get methods() {\n return {\n show: (e) => this.show(e)\n };\n }\n /**\n * Show notification\n *\n * @param {NotifierOptions} options - message option\n */\n show(e) {\n return this.notifier.show(e);\n }\n}\nclass Ti extends E {\n /**\n * Available methods\n */\n get methods() {\n const e = () => this.isEnabled;\n return {\n toggle: (t) => this.toggle(t),\n get isEnabled() {\n return e();\n }\n };\n }\n /**\n * Set or toggle read-only state\n *\n * @param {boolean|undefined} state - set or toggle state\n * @returns {boolean} current value\n */\n toggle(e) {\n return this.Editor.ReadOnly.toggle(e);\n }\n /**\n * Returns current read-only state\n */\n get isEnabled() {\n return this.Editor.ReadOnly.isEnabled;\n }\n}\nvar Xo = { exports: {} };\n(function(n, e) {\n (function(t, o) {\n n.exports = o();\n })(Ce, function() {\n function t(h) {\n var p = h.tags, g = Object.keys(p), f = g.map(function(v) {\n return typeof p[v];\n }).every(function(v) {\n return v === \"object\" || v === \"boolean\" || v === \"function\";\n });\n if (!f)\n throw new Error(\"The configuration was invalid\");\n this.config = h;\n }\n var o = [\"P\", \"LI\", \"TD\", \"TH\", \"DIV\", \"H1\", \"H2\", \"H3\", \"H4\", \"H5\", \"H6\", \"PRE\"];\n function i(h) {\n return o.indexOf(h.nodeName) !== -1;\n }\n var s = [\"A\", \"B\", \"STRONG\", \"I\", \"EM\", \"SUB\", \"SUP\", \"U\", \"STRIKE\"];\n function r(h) {\n return s.indexOf(h.nodeName) !== -1;\n }\n t.prototype.clean = function(h) {\n const p = document.implementation.createHTMLDocument(), g = p.createElement(\"div\");\n return g.innerHTML = h, this._sanitize(p, g), g.innerHTML;\n }, t.prototype._sanitize = function(h, p) {\n var g = a(h, p), f = g.firstChild();\n if (f)\n do {\n if (f.nodeType === Node.TEXT_NODE)\n if (f.data.trim() === \"\" && (f.previousElementSibling && i(f.previousElementSibling) || f.nextElementSibling && i(f.nextElementSibling))) {\n p.removeChild(f), this._sanitize(h, p);\n break;\n } else\n continue;\n if (f.nodeType === Node.COMMENT_NODE) {\n p.removeChild(f), this._sanitize(h, p);\n break;\n }\n var v = r(f), O;\n v && (O = Array.prototype.some.call(f.childNodes, i));\n var T = !!p.parentNode, M = i(p) && i(f) && T, q = f.nodeName.toLowerCase(), F = l(this.config, q, f), H = v && O;\n if (H || c(f, F) || !this.config.keepNestedBlockElements && M) {\n if (!(f.nodeName === \"SCRIPT\" || f.nodeName === \"STYLE\"))\n for (; f.childNodes.length > 0; )\n p.insertBefore(f.childNodes[0], f);\n p.removeChild(f), this._sanitize(h, p);\n break;\n }\n for (var Q = 0; Q < f.attributes.length; Q += 1) {\n var ie = f.attributes[Q];\n u(ie, F, f) && (f.removeAttribute(ie.name), Q = Q - 1);\n }\n this._sanitize(h, f);\n } while (f = g.nextSibling());\n };\n function a(h, p) {\n return h.createTreeWalker(\n p,\n NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT,\n null,\n !1\n );\n }\n function l(h, p, g) {\n return typeof h.tags[p] == \"function\" ? h.tags[p](g) : h.tags[p];\n }\n function c(h, p) {\n return typeof p > \"u\" ? !0 : typeof p == \"boolean\" ? !p : !1;\n }\n function u(h, p, g) {\n var f = h.name.toLowerCase();\n return p === !0 ? !1 : typeof p[f] == \"function\" ? !p[f](h.value, g) : typeof p[f] > \"u\" || p[f] === !1 ? !0 : typeof p[f] == \"string\" ? p[f] !== h.value : !1;\n }\n return t;\n });\n})(Xo);\nvar Si = Xo.exports;\nconst Ii = /* @__PURE__ */ Ke(Si);\nfunction yt(n, e) {\n return n.map((t) => {\n const o = A(e) ? e(t.tool) : e;\n return V(o) || (t.data = wt(t.data, o)), t;\n });\n}\nfunction Z(n, e = {}) {\n const t = {\n tags: e\n };\n return new Ii(t).clean(n);\n}\nfunction wt(n, e) {\n return Array.isArray(n) ? Oi(n, e) : D(n) ? _i(n, e) : te(n) ? Mi(n, e) : n;\n}\nfunction Oi(n, e) {\n return n.map((t) => wt(t, e));\n}\nfunction _i(n, e) {\n const t = {};\n for (const o in n) {\n if (!Object.prototype.hasOwnProperty.call(n, o))\n continue;\n const i = n[o], s = Ai(e[o]) ? e[o] : e;\n t[o] = wt(i, s);\n }\n return t;\n}\nfunction Mi(n, e) {\n return D(e) ? Z(n, e) : e === !1 ? Z(n, {}) : n;\n}\nfunction Ai(n) {\n return D(n) || Gn(n) || A(n);\n}\nclass Li extends E {\n /**\n * Available methods\n *\n * @returns {SanitizerConfig}\n */\n get methods() {\n return {\n clean: (e, t) => this.clean(e, t)\n };\n }\n /**\n * Perform sanitizing of a string\n *\n * @param {string} taintString - what to sanitize\n * @param {SanitizerConfig} config - sanitizer config\n * @returns {string}\n */\n clean(e, t) {\n return Z(e, t);\n }\n}\nclass Pi extends E {\n /**\n * Available methods\n *\n * @returns {Saver}\n */\n get methods() {\n return {\n save: () => this.save()\n };\n }\n /**\n * Return Editor's data\n *\n * @returns {OutputData}\n */\n save() {\n const e = \"Editor's content can not be saved in read-only mode\";\n return this.Editor.ReadOnly.isEnabled ? (X(e, \"warn\"), Promise.reject(new Error(e))) : this.Editor.Saver.save();\n }\n}\nclass Ni extends E {\n constructor() {\n super(...arguments), this.selectionUtils = new b();\n }\n /**\n * Available methods\n *\n * @returns {SelectionAPIInterface}\n */\n get methods() {\n return {\n findParentTag: (e, t) => this.findParentTag(e, t),\n expandToTag: (e) => this.expandToTag(e),\n save: () => this.selectionUtils.save(),\n restore: () => this.selectionUtils.restore(),\n setFakeBackground: () => this.selectionUtils.setFakeBackground(),\n removeFakeBackground: () => this.selectionUtils.removeFakeBackground()\n };\n }\n /**\n * Looks ahead from selection and find passed tag with class name\n *\n * @param {string} tagName - tag to find\n * @param {string} className - tag's class name\n * @returns {HTMLElement|null}\n */\n findParentTag(e, t) {\n return this.selectionUtils.findParentTag(e, t);\n }\n /**\n * Expand selection to passed tag\n *\n * @param {HTMLElement} node - tag that should contain selection\n */\n expandToTag(e) {\n this.selectionUtils.expandToTag(e);\n }\n}\nclass Ri extends E {\n /**\n * Available methods\n */\n get methods() {\n return {\n getBlockTools: () => Array.from(this.Editor.Tools.blockTools.values())\n };\n }\n}\nclass Di extends E {\n /**\n * Exported classes\n */\n get classes() {\n return {\n /**\n * Base Block styles\n */\n block: \"cdx-block\",\n /**\n * Inline Tools styles\n */\n inlineToolButton: \"ce-inline-tool\",\n inlineToolButtonActive: \"ce-inline-tool--active\",\n /**\n * UI elements\n */\n input: \"cdx-input\",\n loader: \"cdx-loader\",\n button: \"cdx-button\",\n /**\n * Settings styles\n */\n settingsButton: \"cdx-settings-button\",\n settingsButtonActive: \"cdx-settings-button--active\"\n };\n }\n}\nclass Fi extends E {\n /**\n * Available methods\n *\n * @returns {Toolbar}\n */\n get methods() {\n return {\n close: () => this.close(),\n open: () => this.open(),\n toggleBlockSettings: (e) => this.toggleBlockSettings(e),\n toggleToolbox: (e) => this.toggleToolbox(e)\n };\n }\n /**\n * Open toolbar\n */\n open() {\n this.Editor.Toolbar.moveAndOpen();\n }\n /**\n * Close toolbar and all included elements\n */\n close() {\n this.Editor.Toolbar.close();\n }\n /**\n * Toggles Block Setting of the current block\n *\n * @param {boolean} openingState \u2014 opening state of Block Setting\n */\n toggleBlockSettings(e) {\n if (this.Editor.BlockManager.currentBlockIndex === -1) {\n X(\"Could't toggle the Toolbar because there is no block selected \", \"warn\");\n return;\n }\n e ?? !this.Editor.BlockSettings.opened ? (this.Editor.Toolbar.moveAndOpen(), this.Editor.BlockSettings.open()) : this.Editor.BlockSettings.close();\n }\n /**\n * Open toolbox\n *\n * @param {boolean} openingState - Opening state of toolbox\n */\n toggleToolbox(e) {\n if (this.Editor.BlockManager.currentBlockIndex === -1) {\n X(\"Could't toggle the Toolbox because there is no block selected \", \"warn\");\n return;\n }\n e ?? !this.Editor.Toolbar.toolbox.opened ? (this.Editor.Toolbar.moveAndOpen(), this.Editor.Toolbar.toolbox.open()) : this.Editor.Toolbar.toolbox.close();\n }\n}\nvar Vo = { exports: {} };\n/*!\n * CodeX.Tooltips\n * \n * @version 1.0.5\n * \n * @licence MIT\n * @author CodeX <https://codex.so>\n * \n * \n */\n(function(n, e) {\n (function(t, o) {\n n.exports = o();\n })(window, function() {\n return function(t) {\n var o = {};\n function i(s) {\n if (o[s])\n return o[s].exports;\n var r = o[s] = { i: s, l: !1, exports: {} };\n return t[s].call(r.exports, r, r.exports, i), r.l = !0, r.exports;\n }\n return i.m = t, i.c = o, i.d = function(s, r, a) {\n i.o(s, r) || Object.defineProperty(s, r, { enumerable: !0, get: a });\n }, i.r = function(s) {\n typeof Symbol < \"u\" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: \"Module\" }), Object.defineProperty(s, \"__esModule\", { value: !0 });\n }, i.t = function(s, r) {\n if (1 & r && (s = i(s)), 8 & r || 4 & r && typeof s == \"object\" && s && s.__esModule)\n return s;\n var a = /* @__PURE__ */ Object.create(null);\n if (i.r(a), Object.defineProperty(a, \"default\", { enumerable: !0, value: s }), 2 & r && typeof s != \"string\")\n for (var l in s)\n i.d(a, l, (function(c) {\n return s[c];\n }).bind(null, l));\n return a;\n }, i.n = function(s) {\n var r = s && s.__esModule ? function() {\n return s.default;\n } : function() {\n return s;\n };\n return i.d(r, \"a\", r), r;\n }, i.o = function(s, r) {\n return Object.prototype.hasOwnProperty.call(s, r);\n }, i.p = \"\", i(i.s = 0);\n }([function(t, o, i) {\n t.exports = i(1);\n }, function(t, o, i) {\n i.r(o), i.d(o, \"default\", function() {\n return s;\n });\n class s {\n constructor() {\n this.nodes = { wrapper: null, content: null }, this.showed = !1, this.offsetTop = 10, this.offsetLeft = 10, this.offsetRight = 10, this.hidingDelay = 0, this.handleWindowScroll = () => {\n this.showed && this.hide(!0);\n }, this.loadStyles(), this.prepare(), window.addEventListener(\"scroll\", this.handleWindowScroll, { passive: !0 });\n }\n get CSS() {\n return { tooltip: \"ct\", tooltipContent: \"ct__content\", tooltipShown: \"ct--shown\", placement: { left: \"ct--left\", bottom: \"ct--bottom\", right: \"ct--right\", top: \"ct--top\" } };\n }\n show(a, l, c) {\n this.nodes.wrapper || this.prepare(), this.hidingTimeout && clearTimeout(this.hidingTimeout);\n const u = Object.assign({ placement: \"bottom\", marginTop: 0, marginLeft: 0, marginRight: 0, marginBottom: 0, delay: 70, hidingDelay: 0 }, c);\n if (u.hidingDelay && (this.hidingDelay = u.hidingDelay), this.nodes.content.innerHTML = \"\", typeof l == \"string\")\n this.nodes.content.appendChild(document.createTextNode(l));\n else {\n if (!(l instanceof Node))\n throw Error(\"[CodeX Tooltip] Wrong type of \u00ABcontent\u00BB passed. It should be an instance of Node or String. But \" + typeof l + \" given.\");\n this.nodes.content.appendChild(l);\n }\n switch (this.nodes.wrapper.classList.remove(...Object.values(this.CSS.placement)), u.placement) {\n case \"top\":\n this.placeTop(a, u);\n break;\n case \"left\":\n this.placeLeft(a, u);\n break;\n case \"right\":\n this.placeRight(a, u);\n break;\n case \"bottom\":\n default:\n this.placeBottom(a, u);\n }\n u && u.delay ? this.showingTimeout = setTimeout(() => {\n this.nodes.wrapper.classList.add(this.CSS.tooltipShown), this.showed = !0;\n }, u.delay) : (this.nodes.wrapper.classList.add(this.CSS.tooltipShown), this.showed = !0);\n }\n hide(a = !1) {\n if (this.hidingDelay && !a)\n return this.hidingTimeout && clearTimeout(this.hidingTimeout), void (this.hidingTimeout = setTimeout(() => {\n this.hide(!0);\n }, this.hidingDelay));\n this.nodes.wrapper.classList.remove(this.CSS.tooltipShown), this.showed = !1, this.showingTimeout && clearTimeout(this.showingTimeout);\n }\n onHover(a, l, c) {\n a.addEventListener(\"mouseenter\", () => {\n this.show(a, l, c);\n }), a.addEventListener(\"mouseleave\", () => {\n this.hide();\n });\n }\n destroy() {\n this.nodes.wrapper.remove(), window.removeEventListener(\"scroll\", this.handleWindowScroll);\n }\n prepare() {\n this.nodes.wrapper = this.make(\"div\", this.CSS.tooltip), this.nodes.content = this.make(\"div\", this.CSS.tooltipContent), this.append(this.nodes.wrapper, this.nodes.content), this.append(document.body, this.nodes.wrapper);\n }\n loadStyles() {\n const a = \"codex-tooltips-style\";\n if (document.getElementById(a))\n return;\n const l = i(2), c = this.make(\"style\", null, { textContent: l.toString(), id: a });\n this.prepend(document.head, c);\n }\n placeBottom(a, l) {\n const c = a.getBoundingClientRect(), u = c.left + a.clientWidth / 2 - this.nodes.wrapper.offsetWidth / 2, h = c.bottom + window.pageYOffset + this.offsetTop + l.marginTop;\n this.applyPlacement(\"bottom\", u, h);\n }\n placeTop(a, l) {\n const c = a.getBoundingClientRect(), u = c.left + a.clientWidth / 2 - this.nodes.wrapper.offsetWidth / 2, h = c.top + window.pageYOffset - this.nodes.wrapper.clientHeight - this.offsetTop;\n this.applyPlacement(\"top\", u, h);\n }\n placeLeft(a, l) {\n const c = a.getBoundingClientRect(), u = c.left - this.nodes.wrapper.offsetWidth - this.offsetLeft - l.marginLeft, h = c.top + window.pageYOffset + a.clientHeight / 2 - this.nodes.wrapper.offsetHeight / 2;\n this.applyPlacement(\"left\", u, h);\n }\n placeRight(a, l) {\n const c = a.getBoundingClientRect(), u = c.right + this.offsetRight + l.marginRight, h = c.top + window.pageYOffset + a.clientHeight / 2 - this.nodes.wrapper.offsetHeight / 2;\n this.applyPlacement(\"right\", u, h);\n }\n applyPlacement(a, l, c) {\n this.nodes.wrapper.classList.add(this.CSS.placement[a]), this.nodes.wrapper.style.left = l + \"px\", this.nodes.wrapper.style.top = c + \"px\";\n }\n make(a, l = null, c = {}) {\n const u = document.createElement(a);\n Array.isArray(l) ? u.classList.add(...l) : l && u.classList.add(l);\n for (const h in c)\n c.hasOwnProperty(h) && (u[h] = c[h]);\n return u;\n }\n append(a, l) {\n Array.isArray(l) ? l.forEach((c) => a.appendChild(c)) : a.appendChild(l);\n }\n prepend(a, l) {\n Array.isArray(l) ? (l = l.reverse()).forEach((c) => a.prepend(c)) : a.prepend(l);\n }\n }\n }, function(t, o) {\n t.exports = `.ct{z-index:999;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;-webkit-transition:opacity 50ms ease-in,-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,transform 70ms cubic-bezier(.215,.61,.355,1),-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);will-change:opacity,top,left;-webkit-box-shadow:0 8px 12px 0 rgba(29,32,43,.17),0 4px 5px -3px rgba(5,6,12,.49);box-shadow:0 8px 12px 0 rgba(29,32,43,.17),0 4px 5px -3px rgba(5,6,12,.49);border-radius:9px}.ct,.ct:before{position:absolute;top:0;left:0}.ct:before{content:\"\";bottom:0;right:0;background-color:#1d202b;z-index:-1;border-radius:4px}@supports(-webkit-mask-box-image:url(\"\")){.ct:before{border-radius:0;-webkit-mask-box-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\"><path d=\"M10.71 0h2.58c3.02 0 4.64.42 6.1 1.2a8.18 8.18 0 013.4 3.4C23.6 6.07 24 7.7 24 10.71v2.58c0 3.02-.42 4.64-1.2 6.1a8.18 8.18 0 01-3.4 3.4c-1.47.8-3.1 1.21-6.11 1.21H10.7c-3.02 0-4.64-.42-6.1-1.2a8.18 8.18 0 01-3.4-3.4C.4 17.93 0 16.3 0 13.29V10.7c0-3.02.42-4.64 1.2-6.1a8.18 8.18 0 013.4-3.4C6.07.4 7.7 0 10.71 0z\"/></svg>') 48% 41% 37.9% 53.3%}}@media (--mobile){.ct{display:none}}.ct__content{padding:6px 10px;color:#cdd1e0;font-size:12px;text-align:center;letter-spacing:.02em;line-height:1em}.ct:after{content:\"\";width:8px;height:8px;position:absolute;background-color:#1d202b;z-index:-1}.ct--bottom{-webkit-transform:translateY(5px);transform:translateY(5px)}.ct--bottom:after{top:-3px;left:50%;-webkit-transform:translateX(-50%) rotate(-45deg);transform:translateX(-50%) rotate(-45deg)}.ct--top{-webkit-transform:translateY(-5px);transform:translateY(-5px)}.ct--top:after{top:auto;bottom:-3px;left:50%;-webkit-transform:translateX(-50%) rotate(-45deg);transform:translateX(-50%) rotate(-45deg)}.ct--left{-webkit-transform:translateX(-5px);transform:translateX(-5px)}.ct--left:after{top:50%;left:auto;right:0;-webkit-transform:translate(41.6%,-50%) rotate(-45deg);transform:translate(41.6%,-50%) rotate(-45deg)}.ct--right{-webkit-transform:translateX(5px);transform:translateX(5px)}.ct--right:after{top:50%;left:0;-webkit-transform:translate(-41.6%,-50%) rotate(-45deg);transform:translate(-41.6%,-50%) rotate(-45deg)}.ct--shown{opacity:1;-webkit-transform:none;transform:none}`;\n }]).default;\n });\n})(Vo);\nvar ji = Vo.exports;\nconst Hi = /* @__PURE__ */ Ke(ji);\nlet U = null;\nfunction Et() {\n U || (U = new Hi());\n}\nfunction $i(n, e, t) {\n Et(), U == null || U.show(n, e, t);\n}\nfunction $e(n = !1) {\n Et(), U == null || U.hide(n);\n}\nfunction ze(n, e, t) {\n Et(), U == null || U.onHover(n, e, t);\n}\nfunction zi() {\n U == null || U.destroy(), U = null;\n}\nclass Ui extends E {\n /**\n * @class\n * @param moduleConfiguration - Module Configuration\n * @param moduleConfiguration.config - Editor's config\n * @param moduleConfiguration.eventsDispatcher - Editor's event dispatcher\n */\n constructor({ config: e, eventsDispatcher: t }) {\n super({\n config: e,\n eventsDispatcher: t\n });\n }\n /**\n * Available methods\n */\n get methods() {\n return {\n show: (e, t, o) => this.show(e, t, o),\n hide: () => this.hide(),\n onHover: (e, t, o) => this.onHover(e, t, o)\n };\n }\n /**\n * Method show tooltip on element with passed HTML content\n *\n * @param {HTMLElement} element - element on which tooltip should be shown\n * @param {TooltipContent} content - tooltip content\n * @param {TooltipOptions} options - tooltip options\n */\n show(e, t, o) {\n $i(e, t, o);\n }\n /**\n * Method hides tooltip on HTML page\n */\n hide() {\n $e();\n }\n /**\n * Decorator for showing Tooltip by mouseenter/mouseleave\n *\n * @param {HTMLElement} element - element on which tooltip should be shown\n * @param {TooltipContent} content - tooltip content\n * @param {TooltipOptions} options - tooltip options\n */\n onHover(e, t, o) {\n ze(e, t, o);\n }\n}\nclass Wi extends E {\n /**\n * Available methods / getters\n */\n get methods() {\n return {\n nodes: this.editorNodes\n /**\n * There can be added some UI methods, like toggleThinMode() etc\n */\n };\n }\n /**\n * Exported classes\n */\n get editorNodes() {\n return {\n /**\n * Top-level editor instance wrapper\n */\n wrapper: this.Editor.UI.nodes.wrapper,\n /**\n * Element that holds all the Blocks\n */\n redactor: this.Editor.UI.nodes.redactor\n };\n }\n}\nfunction qo(n, e) {\n const t = {};\n return Object.entries(n).forEach(([o, i]) => {\n if (D(i)) {\n const s = e ? `${e}.${o}` : o;\n Object.values(i).every((a) => te(a)) ? t[o] = s : t[o] = qo(i, s);\n return;\n }\n t[o] = i;\n }), t;\n}\nconst K = qo(Fo);\nfunction Yi(n, e) {\n const t = {};\n return Object.keys(n).forEach((o) => {\n const i = e[o];\n i !== void 0 ? t[i] = n[o] : t[o] = n[o];\n }), t;\n}\nconst Zo = class Ee {\n /**\n * @param {HTMLElement[]} nodeList \u2014 the list of iterable HTML-items\n * @param {string} focusedCssClass - user-provided CSS-class that will be set in flipping process\n */\n constructor(e, t) {\n this.cursor = -1, this.items = [], this.items = e || [], this.focusedCssClass = t;\n }\n /**\n * Returns Focused button Node\n *\n * @returns {HTMLElement}\n */\n get currentItem() {\n return this.cursor === -1 ? null : this.items[this.cursor];\n }\n /**\n * Sets cursor to specified position\n *\n * @param cursorPosition - new cursor position\n */\n setCursor(e) {\n e < this.items.length && e >= -1 && (this.dropCursor(), this.cursor = e, this.items[this.cursor].classList.add(this.focusedCssClass));\n }\n /**\n * Sets items. Can be used when iterable items changed dynamically\n *\n * @param {HTMLElement[]} nodeList - nodes to iterate\n */\n setItems(e) {\n this.items = e;\n }\n /**\n * Sets cursor next to the current\n */\n next() {\n this.cursor = this.leafNodesAndReturnIndex(Ee.directions.RIGHT);\n }\n /**\n * Sets cursor before current\n */\n previous() {\n this.cursor = this.leafNodesAndReturnIndex(Ee.directions.LEFT);\n }\n /**\n * Sets cursor to the default position and removes CSS-class from previously focused item\n */\n dropCursor() {\n this.cursor !== -1 && (this.items[this.cursor].classList.remove(this.focusedCssClass), this.cursor = -1);\n }\n /**\n * Leafs nodes inside the target list from active element\n *\n * @param {string} direction - leaf direction. Can be 'left' or 'right'\n * @returns {number} index of focused node\n */\n leafNodesAndReturnIndex(e) {\n if (this.items.length === 0)\n return this.cursor;\n let t = this.cursor;\n return t === -1 ? t = e === Ee.directions.RIGHT ? -1 : 0 : this.items[t].classList.remove(this.focusedCssClass), e === Ee.directions.RIGHT ? t = (t + 1) % this.items.length : t = (this.items.length + t - 1) % this.items.length, d.canSetCaret(this.items[t]) && Fe(() => b.setCursor(this.items[t]), 50)(), this.items[t].classList.add(this.focusedCssClass), t;\n }\n};\nZo.directions = {\n RIGHT: \"right\",\n LEFT: \"left\"\n};\nlet ke = Zo;\nclass ce {\n /**\n * @param options - different constructing settings\n */\n constructor(e) {\n this.iterator = null, this.activated = !1, this.flipCallbacks = [], this.onKeyDown = (t) => {\n if (this.isEventReadyForHandling(t))\n switch (ce.usedKeys.includes(t.keyCode) && t.preventDefault(), t.keyCode) {\n case y.TAB:\n this.handleTabPress(t);\n break;\n case y.LEFT:\n case y.UP:\n this.flipLeft();\n break;\n case y.RIGHT:\n case y.DOWN:\n this.flipRight();\n break;\n case y.ENTER:\n this.handleEnterPress(t);\n break;\n }\n }, this.iterator = new ke(e.items, e.focusedItemClass), this.activateCallback = e.activateCallback, this.allowedKeys = e.allowedKeys || ce.usedKeys;\n }\n /**\n * True if flipper is currently activated\n */\n get isActivated() {\n return this.activated;\n }\n /**\n * Array of keys (codes) that is handled by Flipper\n * Used to:\n * - preventDefault only for this keys, not all keydowns (@see constructor)\n * - to skip external behaviours only for these keys, when filler is activated (@see BlockEvents@arrowRightAndDown)\n */\n static get usedKeys() {\n return [\n y.TAB,\n y.LEFT,\n y.RIGHT,\n y.ENTER,\n y.UP,\n y.DOWN\n ];\n }\n /**\n * Active tab/arrows handling by flipper\n *\n * @param items - Some modules (like, InlineToolbar, BlockSettings) might refresh buttons dynamically\n * @param cursorPosition - index of the item that should be focused once flipper is activated\n */\n activate(e, t) {\n this.activated = !0, e && this.iterator.setItems(e), t !== void 0 && this.iterator.setCursor(t), document.addEventListener(\"keydown\", this.onKeyDown, !0);\n }\n /**\n * Disable tab/arrows handling by flipper\n */\n deactivate() {\n this.activated = !1, this.dropCursor(), document.removeEventListener(\"keydown\", this.onKeyDown);\n }\n /**\n * Focus first item\n */\n focusFirst() {\n this.dropCursor(), this.flipRight();\n }\n /**\n * Focuses previous flipper iterator item\n */\n flipLeft() {\n this.iterator.previous(), this.flipCallback();\n }\n /**\n * Focuses next flipper iterator item\n */\n flipRight() {\n this.iterator.next(), this.flipCallback();\n }\n /**\n * Return true if some button is focused\n */\n hasFocus() {\n return !!this.iterator.currentItem;\n }\n /**\n * Registeres function that should be executed on each navigation action\n *\n * @param cb - function to execute\n */\n onFlip(e) {\n this.flipCallbacks.push(e);\n }\n /**\n * Unregisteres function that is executed on each navigation action\n *\n * @param cb - function to stop executing\n */\n removeOnFlip(e) {\n this.flipCallbacks = this.flipCallbacks.filter((t) => t !== e);\n }\n /**\n * Drops flipper's iterator cursor\n *\n * @see DomIterator#dropCursor\n */\n dropCursor() {\n this.iterator.dropCursor();\n }\n /**\n * This function is fired before handling flipper keycodes\n * The result of this function defines if it is need to be handled or not\n *\n * @param {KeyboardEvent} event - keydown keyboard event\n * @returns {boolean}\n */\n isEventReadyForHandling(e) {\n return this.activated && this.allowedKeys.includes(e.keyCode);\n }\n /**\n * When flipper is activated tab press will leaf the items\n *\n * @param {KeyboardEvent} event - tab keydown event\n */\n handleTabPress(e) {\n switch (e.shiftKey ? ke.directions.LEFT : ke.directions.RIGHT) {\n case ke.directions.RIGHT:\n this.flipRight();\n break;\n case ke.directions.LEFT:\n this.flipLeft();\n break;\n }\n }\n /**\n * Enter press will click current item if flipper is activated\n *\n * @param {KeyboardEvent} event - enter keydown event\n */\n handleEnterPress(e) {\n this.activated && (this.iterator.currentItem && (e.stopPropagation(), e.preventDefault(), this.iterator.currentItem.click()), A(this.activateCallback) && this.activateCallback(this.iterator.currentItem));\n }\n /**\n * Fired after flipping in any direction\n */\n flipCallback() {\n this.iterator.currentItem && this.iterator.currentItem.scrollIntoViewIfNeeded(), this.flipCallbacks.forEach((e) => e());\n }\n}\nconst Ki = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M9 12L9 7.1C9 7.04477 9.04477 7 9.1 7H10.4C11.5 7 14 7.1 14 9.5C14 9.5 14 12 11 12M9 12V16.8C9 16.9105 9.08954 17 9.2 17H12.5C14 17 15 16 15 14.5C15 11.7046 11 12 11 12M9 12H11\"/></svg>', Xi = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M7 10L11.8586 14.8586C11.9367 14.9367 12.0633 14.9367 12.1414 14.8586L17 10\"/></svg>', Vi = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M14.5 17.5L9.64142 12.6414C9.56331 12.5633 9.56331 12.4367 9.64142 12.3586L14.5 7.5\"/></svg>', qi = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M9.58284 17.5L14.4414 12.6414C14.5195 12.5633 14.5195 12.4367 14.4414 12.3586L9.58284 7.5\"/></svg>', Zi = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M7 15L11.8586 10.1414C11.9367 10.0633 12.0633 10.0633 12.1414 10.1414L17 15\"/></svg>', Gi = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M8 8L12 12M12 12L16 16M12 12L16 8M12 12L8 16\"/></svg>', Qi = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"4\" stroke=\"currentColor\" stroke-width=\"2\"/></svg>', Ji = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M13.34 10C12.4223 12.7337 11 17 11 17\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M14.21 7H14.2\"/></svg>', Co = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M7.69998 12.6L7.67896 12.62C6.53993 13.7048 6.52012 15.5155 7.63516 16.625V16.625C8.72293 17.7073 10.4799 17.7102 11.5712 16.6314L13.0263 15.193C14.0703 14.1609 14.2141 12.525 13.3662 11.3266L13.22 11.12\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M16.22 11.12L16.3564 10.9805C17.2895 10.0265 17.3478 8.5207 16.4914 7.49733V7.49733C15.5691 6.39509 13.9269 6.25143 12.8271 7.17675L11.3901 8.38588C10.0935 9.47674 9.95706 11.4241 11.0888 12.6852L11.12 12.72\"/></svg>', es = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M9.40999 7.29999H9.4\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M14.6 7.29999H14.59\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M9.30999 12H9.3\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M14.6 12H14.59\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M9.40999 16.7H9.4\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M14.6 16.7H14.59\"/></svg>', ts = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M12 7V12M12 17V12M17 12H12M12 12H7\"/></svg>', Go = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M11.5 17.5L5 11M5 11V15.5M5 11H9.5\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M12.5 6.5L19 13M19 13V8.5M19 13H14.5\"/></svg>', os = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><circle cx=\"10.5\" cy=\"10.5\" r=\"5.5\" stroke=\"currentColor\" stroke-width=\"2\"/><line x1=\"15.4142\" x2=\"19\" y1=\"15\" y2=\"18.5858\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\"/></svg>', ns = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M15.7795 11.5C15.7795 11.5 16.053 11.1962 16.5497 10.6722C17.4442 9.72856 17.4701 8.2475 16.5781 7.30145V7.30145C15.6482 6.31522 14.0873 6.29227 13.1288 7.25073L11.8796 8.49999\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M8.24517 12.3883C8.24517 12.3883 7.97171 12.6922 7.47504 13.2161C6.58051 14.1598 6.55467 15.6408 7.44666 16.5869V16.5869C8.37653 17.5731 9.93744 17.5961 10.8959 16.6376L12.1452 15.3883\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M17.7802 15.1032L16.597 14.9422C16.0109 14.8624 15.4841 15.3059 15.4627 15.8969L15.4199 17.0818\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M6.39064 9.03238L7.58432 9.06668C8.17551 9.08366 8.6522 8.58665 8.61056 7.99669L8.5271 6.81397\"/><line x1=\"12.1142\" x2=\"11.7\" y1=\"12.2\" y2=\"11.7858\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\"/></svg>', is = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><rect width=\"14\" height=\"14\" x=\"5\" y=\"5\" stroke=\"currentColor\" stroke-width=\"2\" rx=\"4\"/><line x1=\"12\" x2=\"12\" y1=\"9\" y2=\"12\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M12 15.02V15.01\"/></svg>', ss = \"__\", rs = \"--\";\nfunction ne(n) {\n return (e, t) => [[n, e].filter((i) => !!i).join(ss), t].filter((i) => !!i).join(rs);\n}\nconst ye = ne(\"ce-hint\"), we = {\n root: ye(),\n alignedStart: ye(null, \"align-left\"),\n alignedCenter: ye(null, \"align-center\"),\n title: ye(\"title\"),\n description: ye(\"description\")\n};\nclass as {\n /**\n * Constructs the hint content instance\n *\n * @param params - hint content parameters\n */\n constructor(e) {\n this.nodes = {\n root: d.make(\"div\", [we.root, e.alignment === \"center\" ? we.alignedCenter : we.alignedStart]),\n title: d.make(\"div\", we.title, { textContent: e.title })\n }, this.nodes.root.appendChild(this.nodes.title), e.description !== void 0 && (this.nodes.description = d.make(\"div\", we.description, { textContent: e.description }), this.nodes.root.appendChild(this.nodes.description));\n }\n /**\n * Returns the root element of the hint content\n */\n getElement() {\n return this.nodes.root;\n }\n}\nclass xt {\n /**\n * Constructs the instance\n *\n * @param params - instance parameters\n */\n constructor(e) {\n this.params = e;\n }\n /**\n * Item name if exists\n */\n get name() {\n if (this.params !== void 0 && \"name\" in this.params)\n return this.params.name;\n }\n /**\n * Destroys the instance\n */\n destroy() {\n $e();\n }\n /**\n * Called when children popover is opened (if exists)\n */\n onChildrenOpen() {\n var e;\n this.params !== void 0 && \"children\" in this.params && typeof ((e = this.params.children) == null ? void 0 : e.onOpen) == \"function\" && this.params.children.onOpen();\n }\n /**\n * Called when children popover is closed (if exists)\n */\n onChildrenClose() {\n var e;\n this.params !== void 0 && \"children\" in this.params && typeof ((e = this.params.children) == null ? void 0 : e.onClose) == \"function\" && this.params.children.onClose();\n }\n /**\n * Called on popover item click\n */\n handleClick() {\n var e, t;\n this.params !== void 0 && \"onActivate\" in this.params && ((t = (e = this.params).onActivate) == null || t.call(e, this.params));\n }\n /**\n * Adds hint to the item element if hint data is provided\n *\n * @param itemElement - popover item root element to add hint to\n * @param hintData - hint data\n */\n addHint(e, t) {\n const o = new as(t);\n ze(e, o.getElement(), {\n placement: t.position,\n hidingDelay: 100\n });\n }\n /**\n * Returns item children that are represented as popover items\n */\n get children() {\n var e;\n return this.params !== void 0 && \"children\" in this.params && ((e = this.params.children) == null ? void 0 : e.items) !== void 0 ? this.params.children.items : [];\n }\n /**\n * Returns true if item has any type of children\n */\n get hasChildren() {\n return this.children.length > 0;\n }\n /**\n * Returns true if item children should be open instantly after popover is opened and not on item click/hover\n */\n get isChildrenOpen() {\n var e;\n return this.params !== void 0 && \"children\" in this.params && ((e = this.params.children) == null ? void 0 : e.isOpen) === !0;\n }\n /**\n * True if item children items should be navigatable via keyboard\n */\n get isChildrenFlippable() {\n var e;\n return !(this.params === void 0 || !(\"children\" in this.params) || ((e = this.params.children) == null ? void 0 : e.isFlippable) === !1);\n }\n /**\n * Returns true if item has children that should be searchable\n */\n get isChildrenSearchable() {\n var e;\n return this.params !== void 0 && \"children\" in this.params && ((e = this.params.children) == null ? void 0 : e.searchable) === !0;\n }\n /**\n * True if popover should close once item is activated\n */\n get closeOnActivate() {\n return this.params !== void 0 && \"closeOnActivate\" in this.params && this.params.closeOnActivate;\n }\n /**\n * True if item is active\n */\n get isActive() {\n return this.params === void 0 || !(\"isActive\" in this.params) ? !1 : typeof this.params.isActive == \"function\" ? this.params.isActive() : this.params.isActive === !0;\n }\n}\nconst Y = ne(\"ce-popover-item\"), L = {\n container: Y(),\n active: Y(null, \"active\"),\n disabled: Y(null, \"disabled\"),\n focused: Y(null, \"focused\"),\n hidden: Y(null, \"hidden\"),\n confirmationState: Y(null, \"confirmation\"),\n noHover: Y(null, \"no-hover\"),\n noFocus: Y(null, \"no-focus\"),\n title: Y(\"title\"),\n secondaryTitle: Y(\"secondary-title\"),\n icon: Y(\"icon\"),\n iconTool: Y(\"icon\", \"tool\"),\n iconChevronRight: Y(\"icon\", \"chevron-right\"),\n wobbleAnimation: ne(\"wobble\")()\n};\nclass re extends xt {\n /**\n * Constructs popover item instance\n *\n * @param params - popover item construction params\n * @param renderParams - popover item render params.\n * The parameters that are not set by user via popover api but rather depend on technical implementation\n */\n constructor(e, t) {\n super(e), this.params = e, this.nodes = {\n root: null,\n icon: null\n }, this.confirmationState = null, this.removeSpecialFocusBehavior = () => {\n var o;\n (o = this.nodes.root) == null || o.classList.remove(L.noFocus);\n }, this.removeSpecialHoverBehavior = () => {\n var o;\n (o = this.nodes.root) == null || o.classList.remove(L.noHover);\n }, this.onErrorAnimationEnd = () => {\n var o, i;\n (o = this.nodes.icon) == null || o.classList.remove(L.wobbleAnimation), (i = this.nodes.icon) == null || i.removeEventListener(\"animationend\", this.onErrorAnimationEnd);\n }, this.nodes.root = this.make(e, t);\n }\n /**\n * True if item is disabled and hence not clickable\n */\n get isDisabled() {\n return this.params.isDisabled === !0;\n }\n /**\n * Exposes popover item toggle parameter\n */\n get toggle() {\n return this.params.toggle;\n }\n /**\n * Item title\n */\n get title() {\n return this.params.title;\n }\n /**\n * True if confirmation state is enabled for popover item\n */\n get isConfirmationStateEnabled() {\n return this.confirmationState !== null;\n }\n /**\n * True if item is focused in keyboard navigation process\n */\n get isFocused() {\n return this.nodes.root === null ? !1 : this.nodes.root.classList.contains(L.focused);\n }\n /**\n * Returns popover item root element\n */\n getElement() {\n return this.nodes.root;\n }\n /**\n * Called on popover item click\n */\n handleClick() {\n if (this.isConfirmationStateEnabled && this.confirmationState !== null) {\n this.activateOrEnableConfirmationMode(this.confirmationState);\n return;\n }\n this.activateOrEnableConfirmationMode(this.params);\n }\n /**\n * Toggles item active state\n *\n * @param isActive - true if item should strictly should become active\n */\n toggleActive(e) {\n var t;\n (t = this.nodes.root) == null || t.classList.toggle(L.active, e);\n }\n /**\n * Toggles item hidden state\n *\n * @param isHidden - true if item should be hidden\n */\n toggleHidden(e) {\n var t;\n (t = this.nodes.root) == null || t.classList.toggle(L.hidden, e);\n }\n /**\n * Resets popover item to its original state\n */\n reset() {\n this.isConfirmationStateEnabled && this.disableConfirmationMode();\n }\n /**\n * Method called once item becomes focused during keyboard navigation\n */\n onFocus() {\n this.disableSpecialHoverAndFocusBehavior();\n }\n /**\n * Constructs HTML element corresponding to popover item params\n *\n * @param params - item construction params\n * @param renderParams - popover item render params\n */\n make(e, t) {\n var s, r;\n const o = (t == null ? void 0 : t.wrapperTag) || \"div\", i = d.make(o, L.container, {\n type: o === \"button\" ? \"button\" : void 0\n });\n return e.name && (i.dataset.itemName = e.name), this.nodes.icon = d.make(\"div\", [L.icon, L.iconTool], {\n innerHTML: e.icon || Qi\n }), i.appendChild(this.nodes.icon), e.title !== void 0 && i.appendChild(d.make(\"div\", L.title, {\n innerHTML: e.title || \"\"\n })), e.secondaryLabel && i.appendChild(d.make(\"div\", L.secondaryTitle, {\n textContent: e.secondaryLabel\n })), this.hasChildren && i.appendChild(d.make(\"div\", [L.icon, L.iconChevronRight], {\n innerHTML: qi\n })), this.isActive && i.classList.add(L.active), e.isDisabled && i.classList.add(L.disabled), e.hint !== void 0 && ((s = t == null ? void 0 : t.hint) == null ? void 0 : s.enabled) !== !1 && this.addHint(i, {\n ...e.hint,\n position: ((r = t == null ? void 0 : t.hint) == null ? void 0 : r.position) || \"right\"\n }), i;\n }\n /**\n * Activates confirmation mode for the item.\n *\n * @param newState - new popover item params that should be applied\n */\n enableConfirmationMode(e) {\n if (this.nodes.root === null)\n return;\n const t = {\n ...this.params,\n ...e,\n confirmation: \"confirmation\" in e ? e.confirmation : void 0\n }, o = this.make(t);\n this.nodes.root.innerHTML = o.innerHTML, this.nodes.root.classList.add(L.confirmationState), this.confirmationState = e, this.enableSpecialHoverAndFocusBehavior();\n }\n /**\n * Returns item to its original state\n */\n disableConfirmationMode() {\n if (this.nodes.root === null)\n return;\n const e = this.make(this.params);\n this.nodes.root.innerHTML = e.innerHTML, this.nodes.root.classList.remove(L.confirmationState), this.confirmationState = null, this.disableSpecialHoverAndFocusBehavior();\n }\n /**\n * Enables special focus and hover behavior for item in confirmation state.\n * This is needed to prevent item from being highlighted as hovered/focused just after click.\n */\n enableSpecialHoverAndFocusBehavior() {\n var e, t, o;\n (e = this.nodes.root) == null || e.classList.add(L.noHover), (t = this.nodes.root) == null || t.classList.add(L.noFocus), (o = this.nodes.root) == null || o.addEventListener(\"mouseleave\", this.removeSpecialHoverBehavior, { once: !0 });\n }\n /**\n * Disables special focus and hover behavior\n */\n disableSpecialHoverAndFocusBehavior() {\n var e;\n this.removeSpecialFocusBehavior(), this.removeSpecialHoverBehavior(), (e = this.nodes.root) == null || e.removeEventListener(\"mouseleave\", this.removeSpecialHoverBehavior);\n }\n /**\n * Executes item's onActivate callback if the item has no confirmation configured\n *\n * @param item - item to activate or bring to confirmation mode\n */\n activateOrEnableConfirmationMode(e) {\n var t;\n if (!(\"confirmation\" in e) || e.confirmation === void 0)\n try {\n (t = e.onActivate) == null || t.call(e, e), this.disableConfirmationMode();\n } catch {\n this.animateError();\n }\n else\n this.enableConfirmationMode(e.confirmation);\n }\n /**\n * Animates item which symbolizes that error occured while executing 'onActivate()' callback\n */\n animateError() {\n var e, t, o;\n (e = this.nodes.icon) != null && e.classList.contains(L.wobbleAnimation) || ((t = this.nodes.icon) == null || t.classList.add(L.wobbleAnimation), (o = this.nodes.icon) == null || o.addEventListener(\"animationend\", this.onErrorAnimationEnd));\n }\n}\nconst nt = ne(\"ce-popover-item-separator\"), it = {\n container: nt(),\n line: nt(\"line\"),\n hidden: nt(null, \"hidden\")\n};\nclass Qo extends xt {\n /**\n * Constructs the instance\n */\n constructor() {\n super(), this.nodes = {\n root: d.make(\"div\", it.container),\n line: d.make(\"div\", it.line)\n }, this.nodes.root.appendChild(this.nodes.line);\n }\n /**\n * Returns popover separator root element\n */\n getElement() {\n return this.nodes.root;\n }\n /**\n * Toggles item hidden state\n *\n * @param isHidden - true if item should be hidden\n */\n toggleHidden(e) {\n var t;\n (t = this.nodes.root) == null || t.classList.toggle(it.hidden, e);\n }\n}\nvar G = /* @__PURE__ */ ((n) => (n.Closed = \"closed\", n.ClosedOnActivate = \"closed-on-activate\", n))(G || {});\nconst $ = ne(\"ce-popover\"), P = {\n popover: $(),\n popoverContainer: $(\"container\"),\n popoverOpenTop: $(null, \"open-top\"),\n popoverOpenLeft: $(null, \"open-left\"),\n popoverOpened: $(null, \"opened\"),\n search: $(\"search\"),\n nothingFoundMessage: $(\"nothing-found-message\"),\n nothingFoundMessageDisplayed: $(\"nothing-found-message\", \"displayed\"),\n items: $(\"items\"),\n overlay: $(\"overlay\"),\n overlayHidden: $(\"overlay\", \"hidden\"),\n popoverNested: $(null, \"nested\"),\n getPopoverNestedClass: (n) => $(null, `nested-level-${n.toString()}`),\n popoverInline: $(null, \"inline\"),\n popoverHeader: $(\"header\")\n};\nvar fe = /* @__PURE__ */ ((n) => (n.NestingLevel = \"--nesting-level\", n.PopoverHeight = \"--popover-height\", n.InlinePopoverWidth = \"--inline-popover-width\", n.TriggerItemLeft = \"--trigger-item-left\", n.TriggerItemTop = \"--trigger-item-top\", n))(fe || {});\nconst To = ne(\"ce-popover-item-html\"), So = {\n root: To(),\n hidden: To(null, \"hidden\")\n};\nclass Se extends xt {\n /**\n * Constructs the instance\n *\n * @param params \u2013 instance parameters\n * @param renderParams \u2013 popover item render params.\n * The parameters that are not set by user via popover api but rather depend on technical implementation\n */\n constructor(e, t) {\n var o, i;\n super(e), this.nodes = {\n root: d.make(\"div\", So.root)\n }, this.nodes.root.appendChild(e.element), e.name && (this.nodes.root.dataset.itemName = e.name), e.hint !== void 0 && ((o = t == null ? void 0 : t.hint) == null ? void 0 : o.enabled) !== !1 && this.addHint(this.nodes.root, {\n ...e.hint,\n position: ((i = t == null ? void 0 : t.hint) == null ? void 0 : i.position) || \"right\"\n });\n }\n /**\n * Returns popover item root element\n */\n getElement() {\n return this.nodes.root;\n }\n /**\n * Toggles item hidden state\n *\n * @param isHidden - true if item should be hidden\n */\n toggleHidden(e) {\n var t;\n (t = this.nodes.root) == null || t.classList.toggle(So.hidden, e);\n }\n /**\n * Returns list of buttons and inputs inside custom content\n */\n getControls() {\n const e = this.nodes.root.querySelectorAll(\n `button, ${d.allInputsSelector}`\n );\n return Array.from(e);\n }\n}\nclass Jo extends Oe {\n /**\n * Constructs the instance\n *\n * @param params - popover construction params\n * @param itemsRenderParams - popover item render params.\n * The parameters that are not set by user via popover api but rather depend on technical implementation\n */\n constructor(e, t = {}) {\n super(), this.params = e, this.itemsRenderParams = t, this.listeners = new _e(), this.messages = {\n nothingFound: \"Nothing found\",\n search: \"Search\"\n }, this.items = this.buildItems(e.items), e.messages && (this.messages = {\n ...this.messages,\n ...e.messages\n }), this.nodes = {}, this.nodes.popoverContainer = d.make(\"div\", [P.popoverContainer]), this.nodes.nothingFoundMessage = d.make(\"div\", [P.nothingFoundMessage], {\n textContent: this.messages.nothingFound\n }), this.nodes.popoverContainer.appendChild(this.nodes.nothingFoundMessage), this.nodes.items = d.make(\"div\", [P.items]), this.items.forEach((o) => {\n const i = o.getElement();\n i !== null && this.nodes.items.appendChild(i);\n }), this.nodes.popoverContainer.appendChild(this.nodes.items), this.listeners.on(this.nodes.popoverContainer, \"click\", (o) => this.handleClick(o)), this.nodes.popover = d.make(\"div\", [\n P.popover,\n this.params.class\n ]), this.nodes.popover.appendChild(this.nodes.popoverContainer);\n }\n /**\n * List of default popover items that are searchable and may have confirmation state\n */\n get itemsDefault() {\n return this.items.filter((e) => e instanceof re);\n }\n /**\n * Returns HTML element corresponding to the popover\n */\n getElement() {\n return this.nodes.popover;\n }\n /**\n * Open popover\n */\n show() {\n this.nodes.popover.classList.add(P.popoverOpened), this.search !== void 0 && this.search.focus();\n }\n /**\n * Closes popover\n */\n hide() {\n this.nodes.popover.classList.remove(P.popoverOpened), this.nodes.popover.classList.remove(P.popoverOpenTop), this.itemsDefault.forEach((e) => e.reset()), this.search !== void 0 && this.search.clear(), this.emit(G.Closed);\n }\n /**\n * Clears memory\n */\n destroy() {\n var e;\n this.items.forEach((t) => t.destroy()), this.nodes.popover.remove(), this.listeners.removeAll(), (e = this.search) == null || e.destroy();\n }\n /**\n * Looks for the item by name and imitates click on it\n *\n * @param name - name of the item to activate\n */\n activateItemByName(e) {\n const t = this.items.find((o) => o.name === e);\n this.handleItemClick(t);\n }\n /**\n * Factory method for creating popover items\n *\n * @param items - list of items params\n */\n buildItems(e) {\n return e.map((t) => {\n switch (t.type) {\n case _.Separator:\n return new Qo();\n case _.Html:\n return new Se(t, this.itemsRenderParams[_.Html]);\n default:\n return new re(t, this.itemsRenderParams[_.Default]);\n }\n });\n }\n /**\n * Retrieves popover item that is the target of the specified event\n *\n * @param event - event to retrieve popover item from\n */\n getTargetItem(e) {\n return this.items.filter((t) => t instanceof re || t instanceof Se).find((t) => {\n const o = t.getElement();\n return o === null ? !1 : e.composedPath().includes(o);\n });\n }\n /**\n * Handles popover item click\n *\n * @param item - item to handle click of\n */\n handleItemClick(e) {\n if (!(\"isDisabled\" in e && e.isDisabled)) {\n if (e.hasChildren) {\n this.showNestedItems(e), \"handleClick\" in e && typeof e.handleClick == \"function\" && e.handleClick();\n return;\n }\n this.itemsDefault.filter((t) => t !== e).forEach((t) => t.reset()), \"handleClick\" in e && typeof e.handleClick == \"function\" && e.handleClick(), this.toggleItemActivenessIfNeeded(e), e.closeOnActivate && (this.hide(), this.emit(G.ClosedOnActivate));\n }\n }\n /**\n * Handles clicks inside popover\n *\n * @param event - item to handle click of\n */\n handleClick(e) {\n const t = this.getTargetItem(e);\n t !== void 0 && this.handleItemClick(t);\n }\n /**\n * - Toggles item active state, if clicked popover item has property 'toggle' set to true.\n *\n * - Performs radiobutton-like behavior if the item has property 'toggle' set to string key.\n * (All the other items with the same key get inactive, and the item gets active)\n *\n * @param clickedItem - popover item that was clicked\n */\n toggleItemActivenessIfNeeded(e) {\n if (e instanceof re && (e.toggle === !0 && e.toggleActive(), typeof e.toggle == \"string\")) {\n const t = this.itemsDefault.filter((o) => o.toggle === e.toggle);\n if (t.length === 1) {\n e.toggleActive();\n return;\n }\n t.forEach((o) => {\n o.toggleActive(o === e);\n });\n }\n }\n}\nvar Ue = /* @__PURE__ */ ((n) => (n.Search = \"search\", n))(Ue || {});\nconst st = ne(\"cdx-search-field\"), rt = {\n wrapper: st(),\n icon: st(\"icon\"),\n input: st(\"input\")\n};\nclass ls extends Oe {\n /**\n * @param options - available config\n * @param options.items - searchable items list\n * @param options.placeholder - input placeholder\n */\n constructor({ items: e, placeholder: t }) {\n super(), this.listeners = new _e(), this.items = e, this.wrapper = d.make(\"div\", rt.wrapper);\n const o = d.make(\"div\", rt.icon, {\n innerHTML: os\n });\n this.input = d.make(\"input\", rt.input, {\n placeholder: t,\n /**\n * Used to prevent focusing on the input by Tab key\n * (Popover in the Toolbar lays below the blocks,\n * so Tab in the last block will focus this hidden input if this property is not set)\n */\n tabIndex: -1\n }), this.wrapper.appendChild(o), this.wrapper.appendChild(this.input), this.listeners.on(this.input, \"input\", () => {\n this.searchQuery = this.input.value, this.emit(Ue.Search, {\n query: this.searchQuery,\n items: this.foundItems\n });\n });\n }\n /**\n * Returns search field element\n */\n getElement() {\n return this.wrapper;\n }\n /**\n * Sets focus to the input\n */\n focus() {\n this.input.focus();\n }\n /**\n * Clears search query and results\n */\n clear() {\n this.input.value = \"\", this.searchQuery = \"\", this.emit(Ue.Search, {\n query: \"\",\n items: this.foundItems\n });\n }\n /**\n * Clears memory\n */\n destroy() {\n this.listeners.removeAll();\n }\n /**\n * Returns list of found items for the current search query\n */\n get foundItems() {\n return this.items.filter((e) => this.checkItem(e));\n }\n /**\n * Contains logic for checking whether passed item conforms the search query\n *\n * @param item - item to be checked\n */\n checkItem(e) {\n var i, s;\n const t = ((i = e.title) == null ? void 0 : i.toLowerCase()) || \"\", o = (s = this.searchQuery) == null ? void 0 : s.toLowerCase();\n return o !== void 0 ? t.includes(o) : !1;\n }\n}\nvar cs = Object.defineProperty, ds = Object.getOwnPropertyDescriptor, us = (n, e, t, o) => {\n for (var i = o > 1 ? void 0 : o ? ds(e, t) : e, s = n.length - 1, r; s >= 0; s--)\n (r = n[s]) && (i = (o ? r(e, t, i) : r(i)) || i);\n return o && i && cs(e, t, i), i;\n};\nconst en = class tn extends Jo {\n /**\n * Construct the instance\n *\n * @param params - popover params\n * @param itemsRenderParams \u2013\u00A0popover item render params.\n * The parameters that are not set by user via popover api but rather depend on technical implementation\n */\n constructor(e, t) {\n super(e, t), this.nestingLevel = 0, this.nestedPopoverTriggerItem = null, this.previouslyHoveredItem = null, this.scopeElement = document.body, this.hide = () => {\n var o;\n super.hide(), this.destroyNestedPopoverIfExists(), (o = this.flipper) == null || o.deactivate(), this.previouslyHoveredItem = null;\n }, this.onFlip = () => {\n const o = this.itemsDefault.find((i) => i.isFocused);\n o == null || o.onFocus();\n }, this.onSearch = (o) => {\n var a;\n const i = o.query === \"\", s = o.items.length === 0;\n this.items.forEach((l) => {\n let c = !1;\n l instanceof re ? c = !o.items.includes(l) : (l instanceof Qo || l instanceof Se) && (c = s || !i), l.toggleHidden(c);\n }), this.toggleNothingFoundMessage(s);\n const r = o.query === \"\" ? this.flippableElements : o.items.map((l) => l.getElement());\n (a = this.flipper) != null && a.isActivated && (this.flipper.deactivate(), this.flipper.activate(r));\n }, e.nestingLevel !== void 0 && (this.nestingLevel = e.nestingLevel), this.nestingLevel > 0 && this.nodes.popover.classList.add(P.popoverNested), e.scopeElement !== void 0 && (this.scopeElement = e.scopeElement), this.nodes.popoverContainer !== null && this.listeners.on(this.nodes.popoverContainer, \"mouseover\", (o) => this.handleHover(o)), e.searchable && this.addSearch(), e.flippable !== !1 && (this.flipper = new ce({\n items: this.flippableElements,\n focusedItemClass: L.focused,\n allowedKeys: [\n y.TAB,\n y.UP,\n y.DOWN,\n y.ENTER\n ]\n }), this.flipper.onFlip(this.onFlip));\n }\n /**\n * Returns true if some item inside popover is focused\n */\n hasFocus() {\n return this.flipper === void 0 ? !1 : this.flipper.hasFocus();\n }\n /**\n * Scroll position inside items container of the popover\n */\n get scrollTop() {\n return this.nodes.items === null ? 0 : this.nodes.items.scrollTop;\n }\n /**\n * Returns visible element offset top\n */\n get offsetTop() {\n return this.nodes.popoverContainer === null ? 0 : this.nodes.popoverContainer.offsetTop;\n }\n /**\n * Open popover\n */\n show() {\n var e;\n this.nodes.popover.style.setProperty(fe.PopoverHeight, this.size.height + \"px\"), this.shouldOpenBottom || this.nodes.popover.classList.add(P.popoverOpenTop), this.shouldOpenRight || this.nodes.popover.classList.add(P.popoverOpenLeft), super.show(), (e = this.flipper) == null || e.activate(this.flippableElements);\n }\n /**\n * Clears memory\n */\n destroy() {\n this.hide(), super.destroy();\n }\n /**\n * Handles displaying nested items for the item.\n *\n * @param item \u2013 item to show nested popover for\n */\n showNestedItems(e) {\n this.nestedPopover !== null && this.nestedPopover !== void 0 || (this.nestedPopoverTriggerItem = e, this.showNestedPopoverForItem(e));\n }\n /**\n * Handles hover events inside popover items container\n *\n * @param event - hover event data\n */\n handleHover(e) {\n const t = this.getTargetItem(e);\n t !== void 0 && this.previouslyHoveredItem !== t && (this.destroyNestedPopoverIfExists(), this.previouslyHoveredItem = t, t.hasChildren && this.showNestedPopoverForItem(t));\n }\n /**\n * Sets CSS variable with position of item near which nested popover should be displayed.\n * Is used for correct positioning of the nested popover\n *\n * @param nestedPopoverEl - nested popover element\n * @param item \u2013 item near which nested popover should be displayed\n */\n setTriggerItemPosition(e, t) {\n const o = t.getElement(), i = (o ? o.offsetTop : 0) - this.scrollTop, s = this.offsetTop + i;\n e.style.setProperty(fe.TriggerItemTop, s + \"px\");\n }\n /**\n * Destroys existing nested popover\n */\n destroyNestedPopoverIfExists() {\n var e, t;\n this.nestedPopover === void 0 || this.nestedPopover === null || (this.nestedPopover.off(G.ClosedOnActivate, this.hide), this.nestedPopover.hide(), this.nestedPopover.destroy(), this.nestedPopover.getElement().remove(), this.nestedPopover = null, (e = this.flipper) == null || e.activate(this.flippableElements), (t = this.nestedPopoverTriggerItem) == null || t.onChildrenClose());\n }\n /**\n * Creates and displays nested popover for specified item.\n * Is used only on desktop\n *\n * @param item - item to display nested popover by\n */\n showNestedPopoverForItem(e) {\n var o;\n this.nestedPopover = new tn({\n searchable: e.isChildrenSearchable,\n items: e.children,\n nestingLevel: this.nestingLevel + 1,\n flippable: e.isChildrenFlippable,\n messages: this.messages\n }), e.onChildrenOpen(), this.nestedPopover.on(G.ClosedOnActivate, this.hide);\n const t = this.nestedPopover.getElement();\n return this.nodes.popover.appendChild(t), this.setTriggerItemPosition(t, e), t.style.setProperty(fe.NestingLevel, this.nestedPopover.nestingLevel.toString()), this.nestedPopover.show(), (o = this.flipper) == null || o.deactivate(), this.nestedPopover;\n }\n /**\n * Checks if popover should be opened bottom.\n * It should happen when there is enough space below or not enough space above\n */\n get shouldOpenBottom() {\n if (this.nodes.popover === void 0 || this.nodes.popover === null)\n return !1;\n const e = this.nodes.popoverContainer.getBoundingClientRect(), t = this.scopeElement.getBoundingClientRect(), o = this.size.height, i = e.top + o, s = e.top - o, r = Math.min(window.innerHeight, t.bottom);\n return s < t.top || i <= r;\n }\n /**\n * Checks if popover should be opened left.\n * It should happen when there is enough space in the right or not enough space in the left\n */\n get shouldOpenRight() {\n if (this.nodes.popover === void 0 || this.nodes.popover === null)\n return !1;\n const e = this.nodes.popover.getBoundingClientRect(), t = this.scopeElement.getBoundingClientRect(), o = this.size.width, i = e.right + o, s = e.left - o, r = Math.min(window.innerWidth, t.right);\n return s < t.left || i <= r;\n }\n get size() {\n var i;\n const e = {\n height: 0,\n width: 0\n };\n if (this.nodes.popover === null)\n return e;\n const t = this.nodes.popover.cloneNode(!0);\n t.style.visibility = \"hidden\", t.style.position = \"absolute\", t.style.top = \"-1000px\", t.classList.add(P.popoverOpened), (i = t.querySelector(\".\" + P.popoverNested)) == null || i.remove(), document.body.appendChild(t);\n const o = t.querySelector(\".\" + P.popoverContainer);\n return e.height = o.offsetHeight, e.width = o.offsetWidth, t.remove(), e;\n }\n /**\n * Returns list of elements available for keyboard navigation.\n */\n get flippableElements() {\n return this.items.map((t) => {\n if (t instanceof re)\n return t.getElement();\n if (t instanceof Se)\n return t.getControls();\n }).flat().filter((t) => t != null);\n }\n /**\n * Adds search to the popover\n */\n addSearch() {\n this.search = new ls({\n items: this.itemsDefault,\n placeholder: this.messages.search\n }), this.search.on(Ue.Search, this.onSearch);\n const e = this.search.getElement();\n e.classList.add(P.search), this.nodes.popoverContainer.insertBefore(e, this.nodes.popoverContainer.firstChild);\n }\n /**\n * Toggles nothing found message visibility\n *\n * @param isDisplayed - true if the message should be displayed\n */\n toggleNothingFoundMessage(e) {\n this.nodes.nothingFoundMessage.classList.toggle(P.nothingFoundMessageDisplayed, e);\n }\n};\nus([\n me\n], en.prototype, \"size\", 1);\nlet Bt = en;\nclass hs extends Bt {\n /**\n * Constructs the instance\n *\n * @param params - instance parameters\n */\n constructor(e) {\n const t = !be();\n super(\n {\n ...e,\n class: P.popoverInline\n },\n {\n [_.Default]: {\n /**\n * We use button instead of div here to fix bug associated with focus loss (which leads to selection change) on click in safari\n *\n * @todo figure out better way to solve the issue\n */\n wrapperTag: \"button\",\n hint: {\n position: \"top\",\n alignment: \"center\",\n enabled: t\n }\n },\n [_.Html]: {\n hint: {\n position: \"top\",\n alignment: \"center\",\n enabled: t\n }\n }\n }\n ), this.items.forEach((o) => {\n !(o instanceof re) && !(o instanceof Se) || o.hasChildren && o.isChildrenOpen && this.showNestedItems(o);\n });\n }\n /**\n * Returns visible element offset top\n */\n get offsetLeft() {\n return this.nodes.popoverContainer === null ? 0 : this.nodes.popoverContainer.offsetLeft;\n }\n /**\n * Open popover\n */\n show() {\n this.nestingLevel === 0 && this.nodes.popover.style.setProperty(\n fe.InlinePopoverWidth,\n this.size.width + \"px\"\n ), super.show();\n }\n /**\n * Disable hover event handling.\n * Overrides parent's class behavior\n */\n handleHover() {\n }\n /**\n * Sets CSS variable with position of item near which nested popover should be displayed.\n * Is used to position nested popover right below clicked item\n *\n * @param nestedPopoverEl - nested popover element\n * @param item \u2013 item near which nested popover should be displayed\n */\n setTriggerItemPosition(e, t) {\n const o = t.getElement(), i = o ? o.offsetLeft : 0, s = this.offsetLeft + i;\n e.style.setProperty(\n fe.TriggerItemLeft,\n s + \"px\"\n );\n }\n /**\n * Handles displaying nested items for the item.\n * Overriding in order to add toggling behaviour\n *\n * @param item \u2013 item to toggle nested popover for\n */\n showNestedItems(e) {\n if (this.nestedPopoverTriggerItem === e) {\n this.destroyNestedPopoverIfExists(), this.nestedPopoverTriggerItem = null;\n return;\n }\n super.showNestedItems(e);\n }\n /**\n * Creates and displays nested popover for specified item.\n * Is used only on desktop\n *\n * @param item - item to display nested popover by\n */\n showNestedPopoverForItem(e) {\n const t = super.showNestedPopoverForItem(e);\n return t.getElement().classList.add(P.getPopoverNestedClass(t.nestingLevel)), t;\n }\n /**\n * Overrides default item click handling.\n * Helps to close nested popover once other item is clicked.\n *\n * @param item - clicked item\n */\n handleItemClick(e) {\n var t;\n e !== this.nestedPopoverTriggerItem && ((t = this.nestedPopoverTriggerItem) == null || t.handleClick(), super.destroyNestedPopoverIfExists()), super.handleItemClick(e);\n }\n}\nconst on = class xe {\n constructor() {\n this.scrollPosition = null;\n }\n /**\n * Locks body element scroll\n */\n lock() {\n pt ? this.lockHard() : document.body.classList.add(xe.CSS.scrollLocked);\n }\n /**\n * Unlocks body element scroll\n */\n unlock() {\n pt ? this.unlockHard() : document.body.classList.remove(xe.CSS.scrollLocked);\n }\n /**\n * Locks scroll in a hard way (via setting fixed position to body element)\n */\n lockHard() {\n this.scrollPosition = window.pageYOffset, document.documentElement.style.setProperty(\n \"--window-scroll-offset\",\n `${this.scrollPosition}px`\n ), document.body.classList.add(xe.CSS.scrollLockedHard);\n }\n /**\n * Unlocks hard scroll lock\n */\n unlockHard() {\n document.body.classList.remove(xe.CSS.scrollLockedHard), this.scrollPosition !== null && window.scrollTo(0, this.scrollPosition), this.scrollPosition = null;\n }\n};\non.CSS = {\n scrollLocked: \"ce-scroll-locked\",\n scrollLockedHard: \"ce-scroll-locked--hard\"\n};\nlet ps = on;\nconst at = ne(\"ce-popover-header\"), lt = {\n root: at(),\n text: at(\"text\"),\n backButton: at(\"back-button\")\n};\nclass fs {\n /**\n * Constructs the instance\n *\n * @param params - popover header params\n */\n constructor({ text: e, onBackButtonClick: t }) {\n this.listeners = new _e(), this.text = e, this.onBackButtonClick = t, this.nodes = {\n root: d.make(\"div\", [lt.root]),\n backButton: d.make(\"button\", [lt.backButton]),\n text: d.make(\"div\", [lt.text])\n }, this.nodes.backButton.innerHTML = Vi, this.nodes.root.appendChild(this.nodes.backButton), this.listeners.on(this.nodes.backButton, \"click\", this.onBackButtonClick), this.nodes.text.innerText = this.text, this.nodes.root.appendChild(this.nodes.text);\n }\n /**\n * Returns popover header root html element\n */\n getElement() {\n return this.nodes.root;\n }\n /**\n * Destroys the instance\n */\n destroy() {\n this.nodes.root.remove(), this.listeners.destroy();\n }\n}\nclass gs {\n constructor() {\n this.history = [];\n }\n /**\n * Push new popover state\n *\n * @param state - new state\n */\n push(e) {\n this.history.push(e);\n }\n /**\n * Pop last popover state\n */\n pop() {\n return this.history.pop();\n }\n /**\n * Title retrieved from the current state\n */\n get currentTitle() {\n return this.history.length === 0 ? \"\" : this.history[this.history.length - 1].title;\n }\n /**\n * Items list retrieved from the current state\n */\n get currentItems() {\n return this.history.length === 0 ? [] : this.history[this.history.length - 1].items;\n }\n /**\n * Returns history to initial popover state\n */\n reset() {\n for (; this.history.length > 1; )\n this.pop();\n }\n}\nclass nn extends Jo {\n /**\n * Construct the instance\n *\n * @param params - popover params\n */\n constructor(e) {\n super(e, {\n [_.Default]: {\n hint: {\n enabled: !1\n }\n },\n [_.Html]: {\n hint: {\n enabled: !1\n }\n }\n }), this.scrollLocker = new ps(), this.history = new gs(), this.isHidden = !0, this.nodes.overlay = d.make(\"div\", [P.overlay, P.overlayHidden]), this.nodes.popover.insertBefore(this.nodes.overlay, this.nodes.popover.firstChild), this.listeners.on(this.nodes.overlay, \"click\", () => {\n this.hide();\n }), this.history.push({ items: e.items });\n }\n /**\n * Open popover\n */\n show() {\n this.nodes.overlay.classList.remove(P.overlayHidden), super.show(), this.scrollLocker.lock(), this.isHidden = !1;\n }\n /**\n * Closes popover\n */\n hide() {\n this.isHidden || (super.hide(), this.nodes.overlay.classList.add(P.overlayHidden), this.scrollLocker.unlock(), this.history.reset(), this.isHidden = !0);\n }\n /**\n * Clears memory\n */\n destroy() {\n super.destroy(), this.scrollLocker.unlock();\n }\n /**\n * Handles displaying nested items for the item\n *\n * @param item \u2013\u00A0item to show nested popover for\n */\n showNestedItems(e) {\n this.updateItemsAndHeader(e.children, e.title), this.history.push({\n title: e.title,\n items: e.children\n });\n }\n /**\n * Removes rendered popover items and header and displays new ones\n *\n * @param items - new popover items\n * @param title - new popover header text\n */\n updateItemsAndHeader(e, t) {\n if (this.header !== null && this.header !== void 0 && (this.header.destroy(), this.header = null), t !== void 0) {\n this.header = new fs({\n text: t,\n onBackButtonClick: () => {\n this.history.pop(), this.updateItemsAndHeader(this.history.currentItems, this.history.currentTitle);\n }\n });\n const o = this.header.getElement();\n o !== null && this.nodes.popoverContainer.insertBefore(o, this.nodes.popoverContainer.firstChild);\n }\n this.items.forEach((o) => {\n var i;\n return (i = o.getElement()) == null ? void 0 : i.remove();\n }), this.items = this.buildItems(e), this.items.forEach((o) => {\n var s;\n const i = o.getElement();\n i !== null && ((s = this.nodes.items) == null || s.appendChild(i));\n });\n }\n}\nclass ms extends E {\n constructor() {\n super(...arguments), this.opened = !1, this.selection = new b(), this.popover = null, this.close = () => {\n this.opened && (this.opened = !1, b.isAtEditor || this.selection.restore(), this.selection.clearSaved(), !this.Editor.CrossBlockSelection.isCrossBlockSelectionStarted && this.Editor.BlockManager.currentBlock && this.Editor.BlockSelection.unselectBlock(this.Editor.BlockManager.currentBlock), this.eventsDispatcher.emit(this.events.closed), this.popover && (this.popover.off(G.Closed, this.onPopoverClose), this.popover.destroy(), this.popover.getElement().remove(), this.popover = null));\n }, this.onPopoverClose = () => {\n this.close();\n };\n }\n /**\n * Module Events\n */\n get events() {\n return {\n opened: \"block-settings-opened\",\n closed: \"block-settings-closed\"\n };\n }\n /**\n * Block Settings CSS\n */\n get CSS() {\n return {\n settings: \"ce-settings\"\n };\n }\n /**\n * Getter for inner popover's flipper instance\n *\n * @todo remove once BlockSettings becomes standalone non-module class\n */\n get flipper() {\n var e;\n if (this.popover !== null)\n return \"flipper\" in this.popover ? (e = this.popover) == null ? void 0 : e.flipper : void 0;\n }\n /**\n * Panel with block settings with 2 sections:\n * - Tool's Settings\n * - Default Settings [Move, Remove, etc]\n */\n make() {\n this.nodes.wrapper = d.make(\"div\", [this.CSS.settings]), this.nodes.wrapper.setAttribute(\"data-cy\", \"block-tunes\"), this.eventsDispatcher.on(Te, this.close);\n }\n /**\n * Destroys module\n */\n destroy() {\n this.removeAllNodes(), this.listeners.destroy(), this.eventsDispatcher.off(Te, this.close);\n }\n /**\n * Open Block Settings pane\n *\n * @param targetBlock - near which Block we should open BlockSettings\n */\n async open(e = this.Editor.BlockManager.currentBlock) {\n var s;\n this.opened = !0, this.selection.save(), this.Editor.BlockSelection.selectBlock(e), this.Editor.BlockSelection.clearCache();\n const { toolTunes: t, commonTunes: o } = e.getTunes();\n this.eventsDispatcher.emit(this.events.opened);\n const i = be() ? nn : Bt;\n this.popover = new i({\n searchable: !0,\n items: await this.getTunesItems(e, o, t),\n scopeElement: this.Editor.API.methods.ui.nodes.redactor,\n messages: {\n nothingFound: z.ui(K.ui.popover, \"Nothing found\"),\n search: z.ui(K.ui.popover, \"Filter\")\n }\n }), this.popover.on(G.Closed, this.onPopoverClose), (s = this.nodes.wrapper) == null || s.append(this.popover.getElement()), this.popover.show();\n }\n /**\n * Returns root block settings element\n */\n getElement() {\n return this.nodes.wrapper;\n }\n /**\n * Returns list of items to be displayed in block tunes menu.\n * Merges tool specific tunes, conversion menu and common tunes in one list in predefined order\n *\n * @param currentBlock \u2013 block we are about to open block tunes for\n * @param commonTunes \u2013 common tunes\n * @param toolTunes - tool specific tunes\n */\n async getTunesItems(e, t, o) {\n const i = [];\n o !== void 0 && o.length > 0 && (i.push(...o), i.push({\n type: _.Separator\n }));\n const s = Array.from(this.Editor.Tools.blockTools.values()), a = (await Yo(e, s)).reduce((l, c) => (c.toolbox.forEach((u) => {\n l.push({\n icon: u.icon,\n title: z.t(K.toolNames, u.title),\n name: c.name,\n closeOnActivate: !0,\n onActivate: async () => {\n const { BlockManager: h, Caret: p, Toolbar: g } = this.Editor, f = await h.convert(e, c.name, u.data);\n g.close(), p.setToBlock(f, p.positions.END);\n }\n });\n }), l), []);\n return a.length > 0 && (i.push({\n icon: Go,\n name: \"convert-to\",\n title: z.ui(K.ui.popover, \"Convert to\"),\n children: {\n searchable: !0,\n items: a\n }\n }), i.push({\n type: _.Separator\n })), i.push(...t), i.map((l) => this.resolveTuneAliases(l));\n }\n /**\n * Resolves aliases in tunes menu items\n *\n * @param item - item with resolved aliases\n */\n resolveTuneAliases(e) {\n if (e.type === _.Separator || e.type === _.Html)\n return e;\n const t = Yi(e, { label: \"title\" });\n return e.confirmation && (t.confirmation = this.resolveTuneAliases(e.confirmation)), t;\n }\n}\nvar sn = { exports: {} };\n/*!\n * Library for handling keyboard shortcuts\n * @copyright CodeX (https://codex.so)\n * @license MIT\n * @author CodeX (https://codex.so)\n * @version 1.2.0\n */\n(function(n, e) {\n (function(t, o) {\n n.exports = o();\n })(window, function() {\n return function(t) {\n var o = {};\n function i(s) {\n if (o[s])\n return o[s].exports;\n var r = o[s] = { i: s, l: !1, exports: {} };\n return t[s].call(r.exports, r, r.exports, i), r.l = !0, r.exports;\n }\n return i.m = t, i.c = o, i.d = function(s, r, a) {\n i.o(s, r) || Object.defineProperty(s, r, { enumerable: !0, get: a });\n }, i.r = function(s) {\n typeof Symbol < \"u\" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: \"Module\" }), Object.defineProperty(s, \"__esModule\", { value: !0 });\n }, i.t = function(s, r) {\n if (1 & r && (s = i(s)), 8 & r || 4 & r && typeof s == \"object\" && s && s.__esModule)\n return s;\n var a = /* @__PURE__ */ Object.create(null);\n if (i.r(a), Object.defineProperty(a, \"default\", { enumerable: !0, value: s }), 2 & r && typeof s != \"string\")\n for (var l in s)\n i.d(a, l, (function(c) {\n return s[c];\n }).bind(null, l));\n return a;\n }, i.n = function(s) {\n var r = s && s.__esModule ? function() {\n return s.default;\n } : function() {\n return s;\n };\n return i.d(r, \"a\", r), r;\n }, i.o = function(s, r) {\n return Object.prototype.hasOwnProperty.call(s, r);\n }, i.p = \"\", i(i.s = 0);\n }([function(t, o, i) {\n function s(l, c) {\n for (var u = 0; u < c.length; u++) {\n var h = c[u];\n h.enumerable = h.enumerable || !1, h.configurable = !0, \"value\" in h && (h.writable = !0), Object.defineProperty(l, h.key, h);\n }\n }\n function r(l, c, u) {\n return c && s(l.prototype, c), u && s(l, u), l;\n }\n i.r(o);\n var a = function() {\n function l(c) {\n var u = this;\n (function(h, p) {\n if (!(h instanceof p))\n throw new TypeError(\"Cannot call a class as a function\");\n })(this, l), this.commands = {}, this.keys = {}, this.name = c.name, this.parseShortcutName(c.name), this.element = c.on, this.callback = c.callback, this.executeShortcut = function(h) {\n u.execute(h);\n }, this.element.addEventListener(\"keydown\", this.executeShortcut, !1);\n }\n return r(l, null, [{ key: \"supportedCommands\", get: function() {\n return { SHIFT: [\"SHIFT\"], CMD: [\"CMD\", \"CONTROL\", \"COMMAND\", \"WINDOWS\", \"CTRL\"], ALT: [\"ALT\", \"OPTION\"] };\n } }, { key: \"keyCodes\", get: function() {\n return { 0: 48, 1: 49, 2: 50, 3: 51, 4: 52, 5: 53, 6: 54, 7: 55, 8: 56, 9: 57, A: 65, B: 66, C: 67, D: 68, E: 69, F: 70, G: 71, H: 72, I: 73, J: 74, K: 75, L: 76, M: 77, N: 78, O: 79, P: 80, Q: 81, R: 82, S: 83, T: 84, U: 85, V: 86, W: 87, X: 88, Y: 89, Z: 90, BACKSPACE: 8, ENTER: 13, ESCAPE: 27, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, INSERT: 45, DELETE: 46, \".\": 190 };\n } }]), r(l, [{ key: \"parseShortcutName\", value: function(c) {\n c = c.split(\"+\");\n for (var u = 0; u < c.length; u++) {\n c[u] = c[u].toUpperCase();\n var h = !1;\n for (var p in l.supportedCommands)\n if (l.supportedCommands[p].includes(c[u])) {\n h = this.commands[p] = !0;\n break;\n }\n h || (this.keys[c[u]] = !0);\n }\n for (var g in l.supportedCommands)\n this.commands[g] || (this.commands[g] = !1);\n } }, { key: \"execute\", value: function(c) {\n var u, h = { CMD: c.ctrlKey || c.metaKey, SHIFT: c.shiftKey, ALT: c.altKey }, p = !0;\n for (u in this.commands)\n this.commands[u] !== h[u] && (p = !1);\n var g, f = !0;\n for (g in this.keys)\n f = f && c.keyCode === l.keyCodes[g];\n p && f && this.callback(c);\n } }, { key: \"remove\", value: function() {\n this.element.removeEventListener(\"keydown\", this.executeShortcut);\n } }]), l;\n }();\n o.default = a;\n }]).default;\n });\n})(sn);\nvar bs = sn.exports;\nconst vs = /* @__PURE__ */ Ke(bs);\nclass ks {\n constructor() {\n this.registeredShortcuts = /* @__PURE__ */ new Map();\n }\n /**\n * Register shortcut\n *\n * @param shortcut - shortcut options\n */\n add(e) {\n if (this.findShortcut(e.on, e.name))\n throw Error(\n `Shortcut ${e.name} is already registered for ${e.on}. Please remove it before add a new handler.`\n );\n const o = new vs({\n name: e.name,\n on: e.on,\n callback: e.handler\n }), i = this.registeredShortcuts.get(e.on) || [];\n this.registeredShortcuts.set(e.on, [...i, o]);\n }\n /**\n * Remove shortcut\n *\n * @param element - Element shortcut is set for\n * @param name - shortcut name\n */\n remove(e, t) {\n const o = this.findShortcut(e, t);\n if (!o)\n return;\n o.remove();\n const i = this.registeredShortcuts.get(e);\n this.registeredShortcuts.set(e, i.filter((s) => s !== o));\n }\n /**\n * Get Shortcut instance if exist\n *\n * @param element - Element shorcut is set for\n * @param shortcut - shortcut name\n * @returns {number} index - shortcut index if exist\n */\n findShortcut(e, t) {\n return (this.registeredShortcuts.get(e) || []).find(({ name: i }) => i === t);\n }\n}\nconst ge = new ks();\nvar ys = Object.defineProperty, ws = Object.getOwnPropertyDescriptor, rn = (n, e, t, o) => {\n for (var i = o > 1 ? void 0 : o ? ws(e, t) : e, s = n.length - 1, r; s >= 0; s--)\n (r = n[s]) && (i = (o ? r(e, t, i) : r(i)) || i);\n return o && i && ys(e, t, i), i;\n}, Le = /* @__PURE__ */ ((n) => (n.Opened = \"toolbox-opened\", n.Closed = \"toolbox-closed\", n.BlockAdded = \"toolbox-block-added\", n))(Le || {});\nconst Ct = class an extends Oe {\n /**\n * Toolbox constructor\n *\n * @param options - available parameters\n * @param options.api - Editor API methods\n * @param options.tools - Tools available to check whether some of them should be displayed at the Toolbox or not\n */\n constructor({ api: e, tools: t, i18nLabels: o }) {\n super(), this.opened = !1, this.listeners = new _e(), this.popover = null, this.handleMobileLayoutToggle = () => {\n this.destroyPopover(), this.initPopover();\n }, this.onPopoverClose = () => {\n this.opened = !1, this.emit(\n \"toolbox-closed\"\n /* Closed */\n );\n }, this.api = e, this.tools = t, this.i18nLabels = o, this.enableShortcuts(), this.nodes = {\n toolbox: d.make(\"div\", an.CSS.toolbox)\n }, this.initPopover(), this.nodes.toolbox.setAttribute(\"data-cy\", \"toolbox\"), this.api.events.on(Te, this.handleMobileLayoutToggle);\n }\n /**\n * Returns True if Toolbox is Empty and nothing to show\n *\n * @returns {boolean}\n */\n get isEmpty() {\n return this.toolsToBeDisplayed.length === 0;\n }\n /**\n * CSS styles\n */\n static get CSS() {\n return {\n toolbox: \"ce-toolbox\"\n };\n }\n /**\n * Returns root block settings element\n */\n getElement() {\n return this.nodes.toolbox;\n }\n /**\n * Returns true if the Toolbox has the Flipper activated and the Flipper has selected button\n */\n hasFocus() {\n if (this.popover !== null)\n return \"hasFocus\" in this.popover ? this.popover.hasFocus() : void 0;\n }\n /**\n * Destroy Module\n */\n destroy() {\n var e;\n super.destroy(), this.nodes && this.nodes.toolbox && this.nodes.toolbox.remove(), this.removeAllShortcuts(), (e = this.popover) == null || e.off(G.Closed, this.onPopoverClose), this.listeners.destroy(), this.api.events.off(Te, this.handleMobileLayoutToggle);\n }\n /**\n * Toolbox Tool's button click handler\n *\n * @param toolName - tool type to be activated\n * @param blockDataOverrides - Block data predefined by the activated Toolbox item\n */\n toolButtonActivated(e, t) {\n this.insertNewBlock(e, t);\n }\n /**\n * Open Toolbox with Tools\n */\n open() {\n var e;\n this.isEmpty || ((e = this.popover) == null || e.show(), this.opened = !0, this.emit(\n \"toolbox-opened\"\n /* Opened */\n ));\n }\n /**\n * Close Toolbox\n */\n close() {\n var e;\n (e = this.popover) == null || e.hide(), this.opened = !1, this.emit(\n \"toolbox-closed\"\n /* Closed */\n );\n }\n /**\n * Close Toolbox\n */\n toggle() {\n this.opened ? this.close() : this.open();\n }\n /**\n * Creates toolbox popover and appends it inside wrapper element\n */\n initPopover() {\n var t;\n const e = be() ? nn : Bt;\n this.popover = new e({\n scopeElement: this.api.ui.nodes.redactor,\n searchable: !0,\n messages: {\n nothingFound: this.i18nLabels.nothingFound,\n search: this.i18nLabels.filter\n },\n items: this.toolboxItemsToBeDisplayed\n }), this.popover.on(G.Closed, this.onPopoverClose), (t = this.nodes.toolbox) == null || t.append(this.popover.getElement());\n }\n /**\n * Destroys popover instance and removes it from DOM\n */\n destroyPopover() {\n this.popover !== null && (this.popover.hide(), this.popover.off(G.Closed, this.onPopoverClose), this.popover.destroy(), this.popover = null), this.nodes.toolbox !== null && (this.nodes.toolbox.innerHTML = \"\");\n }\n get toolsToBeDisplayed() {\n const e = [];\n return this.tools.forEach((t) => {\n t.toolbox && e.push(t);\n }), e;\n }\n get toolboxItemsToBeDisplayed() {\n const e = (t, o, i = !0) => ({\n icon: t.icon,\n title: z.t(K.toolNames, t.title || je(o.name)),\n name: o.name,\n onActivate: () => {\n this.toolButtonActivated(o.name, t.data);\n },\n secondaryLabel: o.shortcut && i ? vt(o.shortcut) : \"\"\n });\n return this.toolsToBeDisplayed.reduce((t, o) => (Array.isArray(o.toolbox) ? o.toolbox.forEach((i, s) => {\n t.push(e(i, o, s === 0));\n }) : o.toolbox !== void 0 && t.push(e(o.toolbox, o)), t), []);\n }\n /**\n * Iterate all tools and enable theirs shortcuts if specified\n */\n enableShortcuts() {\n this.toolsToBeDisplayed.forEach((e) => {\n const t = e.shortcut;\n t && this.enableShortcutForTool(e.name, t);\n });\n }\n /**\n * Enable shortcut Block Tool implemented shortcut\n *\n * @param {string} toolName - Tool name\n * @param {string} shortcut - shortcut according to the ShortcutData Module format\n */\n enableShortcutForTool(e, t) {\n ge.add({\n name: t,\n on: this.api.ui.nodes.redactor,\n handler: async (o) => {\n o.preventDefault();\n const i = this.api.blocks.getCurrentBlockIndex(), s = this.api.blocks.getBlockByIndex(i);\n if (s)\n try {\n const r = await this.api.blocks.convert(s.id, e);\n this.api.caret.setToBlock(r, \"end\");\n return;\n } catch {\n }\n this.insertNewBlock(e);\n }\n });\n }\n /**\n * Removes all added shortcuts\n * Fired when the Read-Only mode is activated\n */\n removeAllShortcuts() {\n this.toolsToBeDisplayed.forEach((e) => {\n const t = e.shortcut;\n t && ge.remove(this.api.ui.nodes.redactor, t);\n });\n }\n /**\n * Inserts new block\n * Can be called when button clicked on Toolbox or by ShortcutData\n *\n * @param {string} toolName - Tool name\n * @param blockDataOverrides - predefined Block data\n */\n async insertNewBlock(e, t) {\n const o = this.api.blocks.getCurrentBlockIndex(), i = this.api.blocks.getBlockByIndex(o);\n if (!i)\n return;\n const s = i.isEmpty ? o : o + 1;\n let r;\n if (t) {\n const l = await this.api.blocks.composeBlockData(e);\n r = Object.assign(l, t);\n }\n const a = this.api.blocks.insert(\n e,\n r,\n void 0,\n s,\n void 0,\n i.isEmpty\n );\n a.call(ee.APPEND_CALLBACK), this.api.caret.setToBlock(s), this.emit(\"toolbox-block-added\", {\n block: a\n }), this.api.toolbar.close();\n }\n};\nrn([\n me\n], Ct.prototype, \"toolsToBeDisplayed\", 1);\nrn([\n me\n], Ct.prototype, \"toolboxItemsToBeDisplayed\", 1);\nlet Es = Ct;\nconst ln = \"block hovered\";\nasync function xs(n, e) {\n const t = navigator.keyboard;\n if (!t)\n return e;\n try {\n return (await t.getLayoutMap()).get(n) || e;\n } catch (o) {\n return console.error(o), e;\n }\n}\nclass Bs extends E {\n /**\n * @class\n * @param moduleConfiguration - Module Configuration\n * @param moduleConfiguration.config - Editor's config\n * @param moduleConfiguration.eventsDispatcher - Editor's event dispatcher\n */\n constructor({ config: e, eventsDispatcher: t }) {\n super({\n config: e,\n eventsDispatcher: t\n }), this.toolboxInstance = null;\n }\n /**\n * CSS styles\n *\n * @returns {object}\n */\n get CSS() {\n return {\n toolbar: \"ce-toolbar\",\n content: \"ce-toolbar__content\",\n actions: \"ce-toolbar__actions\",\n actionsOpened: \"ce-toolbar__actions--opened\",\n toolbarOpened: \"ce-toolbar--opened\",\n openedToolboxHolderModifier: \"codex-editor--toolbox-opened\",\n plusButton: \"ce-toolbar__plus\",\n plusButtonShortcut: \"ce-toolbar__plus-shortcut\",\n settingsToggler: \"ce-toolbar__settings-btn\",\n settingsTogglerHidden: \"ce-toolbar__settings-btn--hidden\"\n };\n }\n /**\n * Returns the Toolbar opening state\n *\n * @returns {boolean}\n */\n get opened() {\n return this.nodes.wrapper.classList.contains(this.CSS.toolbarOpened);\n }\n /**\n * Public interface for accessing the Toolbox\n */\n get toolbox() {\n var e;\n return {\n opened: (e = this.toolboxInstance) == null ? void 0 : e.opened,\n close: () => {\n var t;\n (t = this.toolboxInstance) == null || t.close();\n },\n open: () => {\n if (this.toolboxInstance === null) {\n S(\"toolbox.open() called before initialization is finished\", \"warn\");\n return;\n }\n this.Editor.BlockManager.currentBlock = this.hoveredBlock, this.toolboxInstance.open();\n },\n toggle: () => {\n if (this.toolboxInstance === null) {\n S(\"toolbox.toggle() called before initialization is finished\", \"warn\");\n return;\n }\n this.toolboxInstance.toggle();\n },\n hasFocus: () => {\n var t;\n return (t = this.toolboxInstance) == null ? void 0 : t.hasFocus();\n }\n };\n }\n /**\n * Block actions appearance manipulations\n */\n get blockActions() {\n return {\n hide: () => {\n this.nodes.actions.classList.remove(this.CSS.actionsOpened);\n },\n show: () => {\n this.nodes.actions.classList.add(this.CSS.actionsOpened);\n }\n };\n }\n /**\n * Methods for working with Block Tunes toggler\n */\n get blockTunesToggler() {\n return {\n hide: () => this.nodes.settingsToggler.classList.add(this.CSS.settingsTogglerHidden),\n show: () => this.nodes.settingsToggler.classList.remove(this.CSS.settingsTogglerHidden)\n };\n }\n /**\n * Toggles read-only mode\n *\n * @param {boolean} readOnlyEnabled - read-only mode\n */\n toggleReadOnly(e) {\n e ? (this.destroy(), this.Editor.BlockSettings.destroy(), this.disableModuleBindings()) : window.requestIdleCallback(() => {\n this.drawUI(), this.enableModuleBindings();\n }, { timeout: 2e3 });\n }\n /**\n * Move Toolbar to the passed (or current) Block\n *\n * @param block - block to move Toolbar near it\n */\n moveAndOpen(e = this.Editor.BlockManager.currentBlock) {\n if (this.toolboxInstance === null) {\n S(\"Can't open Toolbar since Editor initialization is not finished yet\", \"warn\");\n return;\n }\n if (this.toolboxInstance.opened && this.toolboxInstance.close(), this.Editor.BlockSettings.opened && this.Editor.BlockSettings.close(), !e)\n return;\n this.hoveredBlock = e;\n const t = e.holder, { isMobile: o } = this.Editor.UI;\n let i;\n const s = 20, r = e.firstInput, a = t.getBoundingClientRect(), l = r !== void 0 ? r.getBoundingClientRect() : null, c = l !== null ? l.top - a.top : null, u = c !== null ? c > s : void 0;\n if (o)\n i = t.offsetTop + t.offsetHeight;\n else if (r === void 0 || u) {\n const h = parseInt(window.getComputedStyle(e.pluginsContent).paddingTop);\n i = t.offsetTop + h;\n } else {\n const h = li(r), p = parseInt(window.getComputedStyle(this.nodes.plusButton).height, 10), g = 8;\n i = t.offsetTop + h - p + g + c;\n }\n this.nodes.wrapper.style.top = `${Math.floor(i)}px`, this.Editor.BlockManager.blocks.length === 1 && e.isEmpty ? this.blockTunesToggler.hide() : this.blockTunesToggler.show(), this.open();\n }\n /**\n * Close the Toolbar\n */\n close() {\n var e, t;\n this.Editor.ReadOnly.isEnabled || ((e = this.nodes.wrapper) == null || e.classList.remove(this.CSS.toolbarOpened), this.blockActions.hide(), (t = this.toolboxInstance) == null || t.close(), this.Editor.BlockSettings.close(), this.reset());\n }\n /**\n * Reset the Toolbar position to prevent DOM height growth, for example after blocks deletion\n */\n reset() {\n this.nodes.wrapper.style.top = \"unset\";\n }\n /**\n * Open Toolbar with Plus Button and Actions\n *\n * @param {boolean} withBlockActions - by default, Toolbar opens with Block Actions.\n * This flag allows to open Toolbar without Actions.\n */\n open(e = !0) {\n this.nodes.wrapper.classList.add(this.CSS.toolbarOpened), e ? this.blockActions.show() : this.blockActions.hide();\n }\n /**\n * Draws Toolbar elements\n */\n async make() {\n this.nodes.wrapper = d.make(\"div\", this.CSS.toolbar), [\"content\", \"actions\"].forEach((s) => {\n this.nodes[s] = d.make(\"div\", this.CSS[s]);\n }), d.append(this.nodes.wrapper, this.nodes.content), d.append(this.nodes.content, this.nodes.actions), this.nodes.plusButton = d.make(\"div\", this.CSS.plusButton, {\n innerHTML: ts\n }), d.append(this.nodes.actions, this.nodes.plusButton), this.readOnlyMutableListeners.on(this.nodes.plusButton, \"click\", () => {\n $e(!0), this.plusButtonClicked();\n }, !1);\n const e = d.make(\"div\");\n e.appendChild(document.createTextNode(z.ui(K.ui.toolbar.toolbox, \"Add\"))), e.appendChild(d.make(\"div\", this.CSS.plusButtonShortcut, {\n textContent: \"/\"\n })), ze(this.nodes.plusButton, e, {\n hidingDelay: 400\n }), this.nodes.settingsToggler = d.make(\"span\", this.CSS.settingsToggler, {\n innerHTML: es\n }), d.append(this.nodes.actions, this.nodes.settingsToggler);\n const t = d.make(\"div\"), o = d.text(z.ui(K.ui.blockTunes.toggler, \"Click to tune\")), i = await xs(\"Slash\", \"/\");\n t.appendChild(o), t.appendChild(d.make(\"div\", this.CSS.plusButtonShortcut, {\n textContent: vt(`CMD + ${i}`)\n })), ze(this.nodes.settingsToggler, t, {\n hidingDelay: 400\n }), d.append(this.nodes.actions, this.makeToolbox()), d.append(this.nodes.actions, this.Editor.BlockSettings.getElement()), d.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper);\n }\n /**\n * Creates the Toolbox instance and return it's rendered element\n */\n makeToolbox() {\n return this.toolboxInstance = new Es({\n api: this.Editor.API.methods,\n tools: this.Editor.Tools.blockTools,\n i18nLabels: {\n filter: z.ui(K.ui.popover, \"Filter\"),\n nothingFound: z.ui(K.ui.popover, \"Nothing found\")\n }\n }), this.toolboxInstance.on(Le.Opened, () => {\n this.Editor.UI.nodes.wrapper.classList.add(this.CSS.openedToolboxHolderModifier);\n }), this.toolboxInstance.on(Le.Closed, () => {\n this.Editor.UI.nodes.wrapper.classList.remove(this.CSS.openedToolboxHolderModifier);\n }), this.toolboxInstance.on(Le.BlockAdded, ({ block: e }) => {\n const { BlockManager: t, Caret: o } = this.Editor, i = t.getBlockById(e.id);\n i.inputs.length === 0 && (i === t.lastBlock ? (t.insertAtEnd(), o.setToBlock(t.lastBlock)) : o.setToBlock(t.nextBlock));\n }), this.toolboxInstance.getElement();\n }\n /**\n * Handler for Plus Button\n */\n plusButtonClicked() {\n var e;\n this.Editor.BlockManager.currentBlock = this.hoveredBlock, (e = this.toolboxInstance) == null || e.toggle();\n }\n /**\n * Enable bindings\n */\n enableModuleBindings() {\n this.readOnlyMutableListeners.on(this.nodes.settingsToggler, \"mousedown\", (e) => {\n var t;\n e.stopPropagation(), this.settingsTogglerClicked(), (t = this.toolboxInstance) != null && t.opened && this.toolboxInstance.close(), $e(!0);\n }, !0), be() || this.eventsDispatcher.on(ln, (e) => {\n var t;\n this.Editor.BlockSettings.opened || (t = this.toolboxInstance) != null && t.opened || this.moveAndOpen(e.block);\n });\n }\n /**\n * Disable bindings\n */\n disableModuleBindings() {\n this.readOnlyMutableListeners.clearAll();\n }\n /**\n * Clicks on the Block Settings toggler\n */\n settingsTogglerClicked() {\n this.Editor.BlockManager.currentBlock = this.hoveredBlock, this.Editor.BlockSettings.opened ? this.Editor.BlockSettings.close() : this.Editor.BlockSettings.open(this.hoveredBlock);\n }\n /**\n * Draws Toolbar UI\n *\n * Toolbar contains BlockSettings and Toolbox.\n * That's why at first we draw its components and then Toolbar itself\n *\n * Steps:\n * - Make Toolbar dependent components like BlockSettings, Toolbox and so on\n * - Make itself and append dependent nodes to itself\n *\n */\n drawUI() {\n this.Editor.BlockSettings.make(), this.make();\n }\n /**\n * Removes all created and saved HTMLElements\n * It is used in Read-Only mode\n */\n destroy() {\n this.removeAllNodes(), this.toolboxInstance && this.toolboxInstance.destroy();\n }\n}\nvar ae = /* @__PURE__ */ ((n) => (n[n.Block = 0] = \"Block\", n[n.Inline = 1] = \"Inline\", n[n.Tune = 2] = \"Tune\", n))(ae || {}), Pe = /* @__PURE__ */ ((n) => (n.Shortcut = \"shortcut\", n.Toolbox = \"toolbox\", n.EnabledInlineTools = \"inlineToolbar\", n.EnabledBlockTunes = \"tunes\", n.Config = \"config\", n))(Pe || {}), cn = /* @__PURE__ */ ((n) => (n.Shortcut = \"shortcut\", n.SanitizeConfig = \"sanitize\", n))(cn || {}), pe = /* @__PURE__ */ ((n) => (n.IsEnabledLineBreaks = \"enableLineBreaks\", n.Toolbox = \"toolbox\", n.ConversionConfig = \"conversionConfig\", n.IsReadOnlySupported = \"isReadOnlySupported\", n.PasteConfig = \"pasteConfig\", n))(pe || {}), We = /* @__PURE__ */ ((n) => (n.IsInline = \"isInline\", n.Title = \"title\", n.IsReadOnlySupported = \"isReadOnlySupported\", n))(We || {}), mt = /* @__PURE__ */ ((n) => (n.IsTune = \"isTune\", n))(mt || {});\nclass Tt {\n /**\n * @class\n * @param {ConstructorOptions} options - Constructor options\n */\n constructor({\n name: e,\n constructable: t,\n config: o,\n api: i,\n isDefault: s,\n isInternal: r = !1,\n defaultPlaceholder: a\n }) {\n this.api = i, this.name = e, this.constructable = t, this.config = o, this.isDefault = s, this.isInternal = r, this.defaultPlaceholder = a;\n }\n /**\n * Returns Tool user configuration\n */\n get settings() {\n const e = this.config.config || {};\n return this.isDefault && !(\"placeholder\" in e) && this.defaultPlaceholder && (e.placeholder = this.defaultPlaceholder), e;\n }\n /**\n * Calls Tool's reset method\n */\n reset() {\n if (A(this.constructable.reset))\n return this.constructable.reset();\n }\n /**\n * Calls Tool's prepare method\n */\n prepare() {\n if (A(this.constructable.prepare))\n return this.constructable.prepare({\n toolName: this.name,\n config: this.settings\n });\n }\n /**\n * Returns shortcut for Tool (internal or specified by user)\n */\n get shortcut() {\n const e = this.constructable.shortcut;\n return this.config.shortcut || e;\n }\n /**\n * Returns Tool's sanitizer configuration\n */\n get sanitizeConfig() {\n return this.constructable.sanitize || {};\n }\n /**\n * Returns true if Tools is inline\n */\n isInline() {\n return this.type === ae.Inline;\n }\n /**\n * Returns true if Tools is block\n */\n isBlock() {\n return this.type === ae.Block;\n }\n /**\n * Returns true if Tools is tune\n */\n isTune() {\n return this.type === ae.Tune;\n }\n}\nclass Cs extends E {\n /**\n * @param moduleConfiguration - Module Configuration\n * @param moduleConfiguration.config - Editor's config\n * @param moduleConfiguration.eventsDispatcher - Editor's event dispatcher\n */\n constructor({ config: e, eventsDispatcher: t }) {\n super({\n config: e,\n eventsDispatcher: t\n }), this.CSS = {\n inlineToolbar: \"ce-inline-toolbar\"\n }, this.opened = !1, this.popover = null, this.toolbarVerticalMargin = be() ? 20 : 6, this.tools = /* @__PURE__ */ new Map(), window.requestIdleCallback(() => {\n this.make();\n }, { timeout: 2e3 });\n }\n /**\n * Moving / appearance\n * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n */\n /**\n * Shows Inline Toolbar if something is selected\n *\n * @param [needToClose] - pass true to close toolbar if it is not allowed.\n * Avoid to use it just for closing IT, better call .close() clearly.\n */\n async tryToShow(e = !1) {\n e && this.close(), this.allowedToShow() && (await this.open(), this.Editor.Toolbar.close());\n }\n /**\n * Hides Inline Toolbar\n */\n close() {\n var e, t;\n if (this.opened) {\n for (const [o, i] of this.tools) {\n const s = this.getToolShortcut(o.name);\n s !== void 0 && ge.remove(this.Editor.UI.nodes.redactor, s), A(i.clear) && i.clear();\n }\n this.tools = /* @__PURE__ */ new Map(), this.reset(), this.opened = !1, (e = this.popover) == null || e.hide(), (t = this.popover) == null || t.destroy(), this.popover = null;\n }\n }\n /**\n * Check if node is contained by Inline Toolbar\n *\n * @param {Node} node \u2014 node to check\n */\n containsNode(e) {\n return this.nodes.wrapper === void 0 ? !1 : this.nodes.wrapper.contains(e);\n }\n /**\n * Removes UI and its components\n */\n destroy() {\n var e;\n this.removeAllNodes(), (e = this.popover) == null || e.destroy(), this.popover = null;\n }\n /**\n * Making DOM\n */\n make() {\n this.nodes.wrapper = d.make(\"div\", [\n this.CSS.inlineToolbar,\n ...this.isRtl ? [this.Editor.UI.CSS.editorRtlFix] : []\n ]), this.nodes.wrapper.setAttribute(\"data-cy\", \"inline-toolbar\"), d.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper);\n }\n /**\n * Shows Inline Toolbar\n */\n async open() {\n var t;\n if (this.opened)\n return;\n this.opened = !0, this.popover !== null && this.popover.destroy(), this.createToolsInstances();\n const e = await this.getPopoverItems();\n this.popover = new hs({\n items: e,\n scopeElement: this.Editor.API.methods.ui.nodes.redactor,\n messages: {\n nothingFound: z.ui(K.ui.popover, \"Nothing found\"),\n search: z.ui(K.ui.popover, \"Filter\")\n }\n }), this.move(this.popover.size.width), (t = this.nodes.wrapper) == null || t.append(this.popover.getElement()), this.popover.show();\n }\n /**\n * Move Toolbar to the selected text\n *\n * @param popoverWidth - width of the toolbar popover\n */\n move(e) {\n const t = b.rect, o = this.Editor.UI.nodes.wrapper.getBoundingClientRect(), i = {\n x: t.x - o.x,\n y: t.y + t.height - // + window.scrollY\n o.top + this.toolbarVerticalMargin\n };\n i.x + e + o.x > this.Editor.UI.contentRect.right && (i.x = this.Editor.UI.contentRect.right - e - o.x), this.nodes.wrapper.style.left = Math.floor(i.x) + \"px\", this.nodes.wrapper.style.top = Math.floor(i.y) + \"px\";\n }\n /**\n * Clear orientation classes and reset position\n */\n reset() {\n this.nodes.wrapper.style.left = \"0\", this.nodes.wrapper.style.top = \"0\";\n }\n /**\n * Need to show Inline Toolbar or not\n */\n allowedToShow() {\n const e = [\"IMG\", \"INPUT\"], t = b.get(), o = b.text;\n if (!t || !t.anchorNode || t.isCollapsed || o.length < 1)\n return !1;\n const i = d.isElement(t.anchorNode) ? t.anchorNode : t.anchorNode.parentElement;\n if (i === null || t !== null && e.includes(i.tagName))\n return !1;\n const s = this.Editor.BlockManager.getBlock(t.anchorNode);\n return !s || this.getTools().some((c) => s.tool.inlineTools.has(c.name)) === !1 ? !1 : i.closest(\"[contenteditable]\") !== null;\n }\n /**\n * Working with Tools\n * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n */\n /**\n * Returns tools that are available for current block\n *\n * Used to check if Inline Toolbar could be shown\n * and to render tools in the Inline Toolbar\n */\n getTools() {\n const e = this.Editor.BlockManager.currentBlock;\n return e ? Array.from(e.tool.inlineTools.values()).filter((o) => !(this.Editor.ReadOnly.isEnabled && o.isReadOnlySupported !== !0)) : [];\n }\n /**\n * Constructs tools instances and saves them to this.tools\n */\n createToolsInstances() {\n this.tools = /* @__PURE__ */ new Map(), this.getTools().forEach((t) => {\n const o = t.create();\n this.tools.set(t, o);\n });\n }\n /**\n * Returns Popover Items for tools segregated by their appearance type: regular items and custom html elements.\n */\n async getPopoverItems() {\n const e = [];\n let t = 0;\n for (const [o, i] of this.tools) {\n const s = await i.render(), r = this.getToolShortcut(o.name);\n if (r !== void 0)\n try {\n this.enableShortcuts(o.name, r);\n } catch {\n }\n const a = r !== void 0 ? vt(r) : void 0, l = z.t(\n K.toolNames,\n o.title || je(o.name)\n );\n [s].flat().forEach((c) => {\n var h, p;\n const u = {\n name: o.name,\n onActivate: () => {\n this.toolClicked(i);\n },\n hint: {\n title: l,\n description: a\n }\n };\n if (d.isElement(c)) {\n const g = {\n ...u,\n element: c,\n type: _.Html\n };\n if (A(i.renderActions)) {\n const f = i.renderActions();\n g.children = {\n isOpen: (h = i.checkState) == null ? void 0 : h.call(i, b.get()),\n /** Disable keyboard navigation in actions, as it might conflict with enter press handling */\n isFlippable: !1,\n items: [\n {\n type: _.Html,\n element: f\n }\n ]\n };\n } else\n (p = i.checkState) == null || p.call(i, b.get());\n e.push(g);\n } else if (c.type === _.Html)\n e.push({\n ...u,\n ...c,\n type: _.Html\n });\n else if (c.type === _.Separator)\n e.push({\n type: _.Separator\n });\n else {\n const g = {\n ...u,\n ...c,\n type: _.Default\n };\n \"children\" in g && t !== 0 && e.push({\n type: _.Separator\n }), e.push(g), \"children\" in g && t < this.tools.size - 1 && e.push({\n type: _.Separator\n });\n }\n }), t++;\n }\n return e;\n }\n /**\n * Get shortcut name for tool\n *\n * @param toolName \u2014 Tool name\n */\n getToolShortcut(e) {\n const { Tools: t } = this.Editor, o = t.inlineTools.get(e), i = t.internal.inlineTools;\n return Array.from(i.keys()).includes(e) ? this.inlineTools[e][cn.Shortcut] : o == null ? void 0 : o.shortcut;\n }\n /**\n * Enable Tool shortcut with Editor Shortcuts Module\n *\n * @param toolName - tool name\n * @param shortcut - shortcut according to the ShortcutData Module format\n */\n enableShortcuts(e, t) {\n ge.add({\n name: t,\n handler: (o) => {\n var s;\n const { currentBlock: i } = this.Editor.BlockManager;\n i && i.tool.enabledInlineTools && (o.preventDefault(), (s = this.popover) == null || s.activateItemByName(e));\n },\n /**\n * We need to bind shortcut to the document to make it work in read-only mode\n */\n on: document\n });\n }\n /**\n * Inline Tool button clicks\n *\n * @param tool - Tool's instance\n */\n toolClicked(e) {\n var o;\n const t = b.range;\n (o = e.surround) == null || o.call(e, t), this.checkToolsState();\n }\n /**\n * Check Tools` state by selection\n */\n checkToolsState() {\n var e;\n (e = this.tools) == null || e.forEach((t) => {\n var o;\n (o = t.checkState) == null || o.call(t, b.get());\n });\n }\n /**\n * Get inline tools tools\n * Tools that has isInline is true\n */\n get inlineTools() {\n const e = {};\n return Array.from(this.Editor.Tools.inlineTools.entries()).forEach(([t, o]) => {\n e[t] = o.create();\n }), e;\n }\n}\nfunction dn() {\n const n = window.getSelection();\n if (n === null)\n return [null, 0];\n let e = n.focusNode, t = n.focusOffset;\n return e === null ? [null, 0] : (e.nodeType !== Node.TEXT_NODE && e.childNodes.length > 0 && (e.childNodes[t] ? (e = e.childNodes[t], t = 0) : (e = e.childNodes[t - 1], t = e.textContent.length)), [e, t]);\n}\nfunction un(n, e, t, o) {\n const i = document.createRange();\n o === \"left\" ? (i.setStart(n, 0), i.setEnd(e, t)) : (i.setStart(e, t), i.setEnd(n, n.childNodes.length));\n const s = i.cloneContents(), r = document.createElement(\"div\");\n r.appendChild(s);\n const a = r.textContent || \"\";\n return ai(a);\n}\nfunction Ne(n) {\n const e = d.getDeepestNode(n);\n if (e === null || d.isEmpty(n))\n return !0;\n if (d.isNativeInput(e))\n return e.selectionEnd === 0;\n if (d.isEmpty(n))\n return !0;\n const [t, o] = dn();\n return t === null ? !1 : un(n, t, o, \"left\");\n}\nfunction Re(n) {\n const e = d.getDeepestNode(n, !0);\n if (e === null)\n return !0;\n if (d.isNativeInput(e))\n return e.selectionEnd === e.value.length;\n const [t, o] = dn();\n return t === null ? !1 : un(n, t, o, \"right\");\n}\nvar hn = {}, St = {}, Xe = {}, de = {}, It = {}, Ot = {};\nObject.defineProperty(Ot, \"__esModule\", { value: !0 });\nOt.allInputsSelector = Ts;\nfunction Ts() {\n var n = [\"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", \"url\"];\n return \"[contenteditable=true], textarea, input:not([type]), \" + n.map(function(e) {\n return 'input[type=\"'.concat(e, '\"]');\n }).join(\", \");\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.allInputsSelector = void 0;\n var e = Ot;\n Object.defineProperty(n, \"allInputsSelector\", { enumerable: !0, get: function() {\n return e.allInputsSelector;\n } });\n})(It);\nvar ue = {}, _t = {};\nObject.defineProperty(_t, \"__esModule\", { value: !0 });\n_t.isNativeInput = Ss;\nfunction Ss(n) {\n var e = [\n \"INPUT\",\n \"TEXTAREA\"\n ];\n return n && n.tagName ? e.includes(n.tagName) : !1;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isNativeInput = void 0;\n var e = _t;\n Object.defineProperty(n, \"isNativeInput\", { enumerable: !0, get: function() {\n return e.isNativeInput;\n } });\n})(ue);\nvar pn = {}, Mt = {};\nObject.defineProperty(Mt, \"__esModule\", { value: !0 });\nMt.append = Is;\nfunction Is(n, e) {\n Array.isArray(e) ? e.forEach(function(t) {\n n.appendChild(t);\n }) : n.appendChild(e);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.append = void 0;\n var e = Mt;\n Object.defineProperty(n, \"append\", { enumerable: !0, get: function() {\n return e.append;\n } });\n})(pn);\nvar At = {}, Lt = {};\nObject.defineProperty(Lt, \"__esModule\", { value: !0 });\nLt.blockElements = Os;\nfunction Os() {\n return [\n \"address\",\n \"article\",\n \"aside\",\n \"blockquote\",\n \"canvas\",\n \"div\",\n \"dl\",\n \"dt\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"footer\",\n \"form\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"li\",\n \"main\",\n \"nav\",\n \"noscript\",\n \"ol\",\n \"output\",\n \"p\",\n \"pre\",\n \"ruby\",\n \"section\",\n \"table\",\n \"tbody\",\n \"thead\",\n \"tr\",\n \"tfoot\",\n \"ul\",\n \"video\"\n ];\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.blockElements = void 0;\n var e = Lt;\n Object.defineProperty(n, \"blockElements\", { enumerable: !0, get: function() {\n return e.blockElements;\n } });\n})(At);\nvar fn = {}, Pt = {};\nObject.defineProperty(Pt, \"__esModule\", { value: !0 });\nPt.calculateBaseline = _s;\nfunction _s(n) {\n var e = window.getComputedStyle(n), t = parseFloat(e.fontSize), o = parseFloat(e.lineHeight) || t * 1.2, i = parseFloat(e.paddingTop), s = parseFloat(e.borderTopWidth), r = parseFloat(e.marginTop), a = t * 0.8, l = (o - t) / 2, c = r + s + i + l + a;\n return c;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.calculateBaseline = void 0;\n var e = Pt;\n Object.defineProperty(n, \"calculateBaseline\", { enumerable: !0, get: function() {\n return e.calculateBaseline;\n } });\n})(fn);\nvar gn = {}, Nt = {}, Rt = {}, Dt = {};\nObject.defineProperty(Dt, \"__esModule\", { value: !0 });\nDt.isContentEditable = Ms;\nfunction Ms(n) {\n return n.contentEditable === \"true\";\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isContentEditable = void 0;\n var e = Dt;\n Object.defineProperty(n, \"isContentEditable\", { enumerable: !0, get: function() {\n return e.isContentEditable;\n } });\n})(Rt);\nObject.defineProperty(Nt, \"__esModule\", { value: !0 });\nNt.canSetCaret = Ps;\nvar As = ue, Ls = Rt;\nfunction Ps(n) {\n var e = !0;\n if ((0, As.isNativeInput)(n))\n switch (n.type) {\n case \"file\":\n case \"checkbox\":\n case \"radio\":\n case \"hidden\":\n case \"submit\":\n case \"button\":\n case \"image\":\n case \"reset\":\n e = !1;\n break;\n }\n else\n e = (0, Ls.isContentEditable)(n);\n return e;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.canSetCaret = void 0;\n var e = Nt;\n Object.defineProperty(n, \"canSetCaret\", { enumerable: !0, get: function() {\n return e.canSetCaret;\n } });\n})(gn);\nvar Ve = {}, Ft = {};\nfunction Ns(n, e, t) {\n const o = t.value !== void 0 ? \"value\" : \"get\", i = t[o], s = `#${e}Cache`;\n if (t[o] = function(...r) {\n return this[s] === void 0 && (this[s] = i.apply(this, r)), this[s];\n }, o === \"get\" && t.set) {\n const r = t.set;\n t.set = function(a) {\n delete n[s], r.apply(this, a);\n };\n }\n return t;\n}\nfunction mn() {\n const n = {\n win: !1,\n mac: !1,\n x11: !1,\n linux: !1\n }, e = Object.keys(n).find((t) => window.navigator.appVersion.toLowerCase().indexOf(t) !== -1);\n return e !== void 0 && (n[e] = !0), n;\n}\nfunction jt(n) {\n return n != null && n !== \"\" && (typeof n != \"object\" || Object.keys(n).length > 0);\n}\nfunction Rs(n) {\n return !jt(n);\n}\nconst Ds = () => typeof window < \"u\" && window.navigator !== null && jt(window.navigator.platform) && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === \"MacIntel\" && window.navigator.maxTouchPoints > 1);\nfunction Fs(n) {\n const e = mn();\n return n = n.replace(/shift/gi, \"\u21E7\").replace(/backspace/gi, \"\u232B\").replace(/enter/gi, \"\u23CE\").replace(/up/gi, \"\u2191\").replace(/left/gi, \"\u2192\").replace(/down/gi, \"\u2193\").replace(/right/gi, \"\u2190\").replace(/escape/gi, \"\u238B\").replace(/insert/gi, \"Ins\").replace(/delete/gi, \"\u2421\").replace(/\\+/gi, \"+\"), e.mac ? n = n.replace(/ctrl|cmd/gi, \"\u2318\").replace(/alt/gi, \"\u2325\") : n = n.replace(/cmd/gi, \"Ctrl\").replace(/windows/gi, \"WIN\"), n;\n}\nfunction js(n) {\n return n[0].toUpperCase() + n.slice(1);\n}\nfunction Hs(n) {\n const e = document.createElement(\"div\");\n e.style.position = \"absolute\", e.style.left = \"-999px\", e.style.bottom = \"-999px\", e.innerHTML = n, document.body.appendChild(e);\n const t = window.getSelection(), o = document.createRange();\n if (o.selectNode(e), t === null)\n throw new Error(\"Cannot copy text to clipboard\");\n t.removeAllRanges(), t.addRange(o), document.execCommand(\"copy\"), document.body.removeChild(e);\n}\nfunction $s(n, e, t) {\n let o;\n return (...i) => {\n const s = this, r = () => {\n o = void 0, t !== !0 && n.apply(s, i);\n }, a = t === !0 && o !== void 0;\n window.clearTimeout(o), o = window.setTimeout(r, e), a && n.apply(s, i);\n };\n}\nfunction oe(n) {\n return Object.prototype.toString.call(n).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\nfunction zs(n) {\n return oe(n) === \"boolean\";\n}\nfunction bn(n) {\n return oe(n) === \"function\" || oe(n) === \"asyncfunction\";\n}\nfunction Us(n) {\n return bn(n) && /^\\s*class\\s+/.test(n.toString());\n}\nfunction Ws(n) {\n return oe(n) === \"number\";\n}\nfunction De(n) {\n return oe(n) === \"object\";\n}\nfunction Ys(n) {\n return Promise.resolve(n) === n;\n}\nfunction Ks(n) {\n return oe(n) === \"string\";\n}\nfunction Xs(n) {\n return oe(n) === \"undefined\";\n}\nfunction bt(n, ...e) {\n if (!e.length)\n return n;\n const t = e.shift();\n if (De(n) && De(t))\n for (const o in t)\n De(t[o]) ? (n[o] === void 0 && Object.assign(n, { [o]: {} }), bt(n[o], t[o])) : Object.assign(n, { [o]: t[o] });\n return bt(n, ...e);\n}\nfunction Vs(n, e, t) {\n const o = `\u00AB${e}\u00BB is deprecated and will be removed in the next major release. Please use the \u00AB${t}\u00BB instead.`;\n n && console.warn(o);\n}\nfunction qs(n) {\n try {\n return new URL(n).href;\n } catch {\n }\n return n.substring(0, 2) === \"//\" ? window.location.protocol + n : window.location.origin + n;\n}\nfunction Zs(n) {\n return n > 47 && n < 58 || n === 32 || n === 13 || n === 229 || n > 64 && n < 91 || n > 95 && n < 112 || n > 185 && n < 193 || n > 218 && n < 223;\n}\nconst Gs = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n SHIFT: 16,\n CTRL: 17,\n ALT: 18,\n ESC: 27,\n SPACE: 32,\n LEFT: 37,\n UP: 38,\n DOWN: 40,\n RIGHT: 39,\n DELETE: 46,\n META: 91,\n SLASH: 191\n}, Qs = {\n LEFT: 0,\n WHEEL: 1,\n RIGHT: 2,\n BACKWARD: 3,\n FORWARD: 4\n};\nlet Js = class {\n constructor() {\n this.completed = Promise.resolve();\n }\n /**\n * Add new promise to queue\n * @param operation - promise should be added to queue\n */\n add(e) {\n return new Promise((t, o) => {\n this.completed = this.completed.then(e).then(t).catch(o);\n });\n }\n};\nfunction er(n, e, t = void 0) {\n let o, i, s, r = null, a = 0;\n t || (t = {});\n const l = function() {\n a = t.leading === !1 ? 0 : Date.now(), r = null, s = n.apply(o, i), r === null && (o = i = null);\n };\n return function() {\n const c = Date.now();\n !a && t.leading === !1 && (a = c);\n const u = e - (c - a);\n return o = this, i = arguments, u <= 0 || u > e ? (r && (clearTimeout(r), r = null), a = c, s = n.apply(o, i), r === null && (o = i = null)) : !r && t.trailing !== !1 && (r = setTimeout(l, u)), s;\n };\n}\nconst tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n PromiseQueue: Js,\n beautifyShortcut: Fs,\n cacheable: Ns,\n capitalize: js,\n copyTextToClipboard: Hs,\n debounce: $s,\n deepMerge: bt,\n deprecationAssert: Vs,\n getUserOS: mn,\n getValidUrl: qs,\n isBoolean: zs,\n isClass: Us,\n isEmpty: Rs,\n isFunction: bn,\n isIosDevice: Ds,\n isNumber: Ws,\n isObject: De,\n isPrintableKey: Zs,\n isPromise: Ys,\n isString: Ks,\n isUndefined: Xs,\n keyCodes: Gs,\n mouseButtons: Qs,\n notEmpty: jt,\n throttle: er,\n typeOf: oe\n}, Symbol.toStringTag, { value: \"Module\" })), Ht = /* @__PURE__ */ Xn(tr);\nObject.defineProperty(Ft, \"__esModule\", { value: !0 });\nFt.containsOnlyInlineElements = ir;\nvar or = Ht, nr = At;\nfunction ir(n) {\n var e;\n (0, or.isString)(n) ? (e = document.createElement(\"div\"), e.innerHTML = n) : e = n;\n var t = function(o) {\n return !(0, nr.blockElements)().includes(o.tagName.toLowerCase()) && Array.from(o.children).every(t);\n };\n return Array.from(e.children).every(t);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.containsOnlyInlineElements = void 0;\n var e = Ft;\n Object.defineProperty(n, \"containsOnlyInlineElements\", { enumerable: !0, get: function() {\n return e.containsOnlyInlineElements;\n } });\n})(Ve);\nvar vn = {}, $t = {}, qe = {}, zt = {};\nObject.defineProperty(zt, \"__esModule\", { value: !0 });\nzt.make = sr;\nfunction sr(n, e, t) {\n var o;\n e === void 0 && (e = null), t === void 0 && (t = {});\n var i = document.createElement(n);\n if (Array.isArray(e)) {\n var s = e.filter(function(a) {\n return a !== void 0;\n });\n (o = i.classList).add.apply(o, s);\n } else\n e !== null && i.classList.add(e);\n for (var r in t)\n Object.prototype.hasOwnProperty.call(t, r) && (i[r] = t[r]);\n return i;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.make = void 0;\n var e = zt;\n Object.defineProperty(n, \"make\", { enumerable: !0, get: function() {\n return e.make;\n } });\n})(qe);\nObject.defineProperty($t, \"__esModule\", { value: !0 });\n$t.fragmentToString = ar;\nvar rr = qe;\nfunction ar(n) {\n var e = (0, rr.make)(\"div\");\n return e.appendChild(n), e.innerHTML;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.fragmentToString = void 0;\n var e = $t;\n Object.defineProperty(n, \"fragmentToString\", { enumerable: !0, get: function() {\n return e.fragmentToString;\n } });\n})(vn);\nvar kn = {}, Ut = {};\nObject.defineProperty(Ut, \"__esModule\", { value: !0 });\nUt.getContentLength = cr;\nvar lr = ue;\nfunction cr(n) {\n var e, t;\n return (0, lr.isNativeInput)(n) ? n.value.length : n.nodeType === Node.TEXT_NODE ? n.length : (t = (e = n.textContent) === null || e === void 0 ? void 0 : e.length) !== null && t !== void 0 ? t : 0;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.getContentLength = void 0;\n var e = Ut;\n Object.defineProperty(n, \"getContentLength\", { enumerable: !0, get: function() {\n return e.getContentLength;\n } });\n})(kn);\nvar Wt = {}, Yt = {}, Io = Ce && Ce.__spreadArray || function(n, e, t) {\n if (t || arguments.length === 2)\n for (var o = 0, i = e.length, s; o < i; o++)\n (s || !(o in e)) && (s || (s = Array.prototype.slice.call(e, 0, o)), s[o] = e[o]);\n return n.concat(s || Array.prototype.slice.call(e));\n};\nObject.defineProperty(Yt, \"__esModule\", { value: !0 });\nYt.getDeepestBlockElements = yn;\nvar dr = Ve;\nfunction yn(n) {\n return (0, dr.containsOnlyInlineElements)(n) ? [n] : Array.from(n.children).reduce(function(e, t) {\n return Io(Io([], e, !0), yn(t), !0);\n }, []);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.getDeepestBlockElements = void 0;\n var e = Yt;\n Object.defineProperty(n, \"getDeepestBlockElements\", { enumerable: !0, get: function() {\n return e.getDeepestBlockElements;\n } });\n})(Wt);\nvar wn = {}, Kt = {}, Ze = {}, Xt = {};\nObject.defineProperty(Xt, \"__esModule\", { value: !0 });\nXt.isLineBreakTag = ur;\nfunction ur(n) {\n return [\n \"BR\",\n \"WBR\"\n ].includes(n.tagName);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isLineBreakTag = void 0;\n var e = Xt;\n Object.defineProperty(n, \"isLineBreakTag\", { enumerable: !0, get: function() {\n return e.isLineBreakTag;\n } });\n})(Ze);\nvar Ge = {}, Vt = {};\nObject.defineProperty(Vt, \"__esModule\", { value: !0 });\nVt.isSingleTag = hr;\nfunction hr(n) {\n return [\n \"AREA\",\n \"BASE\",\n \"BR\",\n \"COL\",\n \"COMMAND\",\n \"EMBED\",\n \"HR\",\n \"IMG\",\n \"INPUT\",\n \"KEYGEN\",\n \"LINK\",\n \"META\",\n \"PARAM\",\n \"SOURCE\",\n \"TRACK\",\n \"WBR\"\n ].includes(n.tagName);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isSingleTag = void 0;\n var e = Vt;\n Object.defineProperty(n, \"isSingleTag\", { enumerable: !0, get: function() {\n return e.isSingleTag;\n } });\n})(Ge);\nObject.defineProperty(Kt, \"__esModule\", { value: !0 });\nKt.getDeepestNode = En;\nvar pr = ue, fr = Ze, gr = Ge;\nfunction En(n, e) {\n e === void 0 && (e = !1);\n var t = e ? \"lastChild\" : \"firstChild\", o = e ? \"previousSibling\" : \"nextSibling\";\n if (n.nodeType === Node.ELEMENT_NODE && n[t]) {\n var i = n[t];\n if ((0, gr.isSingleTag)(i) && !(0, pr.isNativeInput)(i) && !(0, fr.isLineBreakTag)(i))\n if (i[o])\n i = i[o];\n else if (i.parentNode !== null && i.parentNode[o])\n i = i.parentNode[o];\n else\n return i.parentNode;\n return En(i, e);\n }\n return n;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.getDeepestNode = void 0;\n var e = Kt;\n Object.defineProperty(n, \"getDeepestNode\", { enumerable: !0, get: function() {\n return e.getDeepestNode;\n } });\n})(wn);\nvar xn = {}, qt = {}, Me = Ce && Ce.__spreadArray || function(n, e, t) {\n if (t || arguments.length === 2)\n for (var o = 0, i = e.length, s; o < i; o++)\n (s || !(o in e)) && (s || (s = Array.prototype.slice.call(e, 0, o)), s[o] = e[o]);\n return n.concat(s || Array.prototype.slice.call(e));\n};\nObject.defineProperty(qt, \"__esModule\", { value: !0 });\nqt.findAllInputs = yr;\nvar mr = Ve, br = Wt, vr = It, kr = ue;\nfunction yr(n) {\n return Array.from(n.querySelectorAll((0, vr.allInputsSelector)())).reduce(function(e, t) {\n return (0, kr.isNativeInput)(t) || (0, mr.containsOnlyInlineElements)(t) ? Me(Me([], e, !0), [t], !1) : Me(Me([], e, !0), (0, br.getDeepestBlockElements)(t), !0);\n }, []);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.findAllInputs = void 0;\n var e = qt;\n Object.defineProperty(n, \"findAllInputs\", { enumerable: !0, get: function() {\n return e.findAllInputs;\n } });\n})(xn);\nvar Bn = {}, Zt = {};\nObject.defineProperty(Zt, \"__esModule\", { value: !0 });\nZt.isCollapsedWhitespaces = wr;\nfunction wr(n) {\n return !/[^\\t\\n\\r ]/.test(n);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isCollapsedWhitespaces = void 0;\n var e = Zt;\n Object.defineProperty(n, \"isCollapsedWhitespaces\", { enumerable: !0, get: function() {\n return e.isCollapsedWhitespaces;\n } });\n})(Bn);\nvar Gt = {}, Qt = {};\nObject.defineProperty(Qt, \"__esModule\", { value: !0 });\nQt.isElement = xr;\nvar Er = Ht;\nfunction xr(n) {\n return (0, Er.isNumber)(n) ? !1 : !!n && !!n.nodeType && n.nodeType === Node.ELEMENT_NODE;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isElement = void 0;\n var e = Qt;\n Object.defineProperty(n, \"isElement\", { enumerable: !0, get: function() {\n return e.isElement;\n } });\n})(Gt);\nvar Cn = {}, Jt = {}, eo = {}, to = {};\nObject.defineProperty(to, \"__esModule\", { value: !0 });\nto.isLeaf = Br;\nfunction Br(n) {\n return n === null ? !1 : n.childNodes.length === 0;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isLeaf = void 0;\n var e = to;\n Object.defineProperty(n, \"isLeaf\", { enumerable: !0, get: function() {\n return e.isLeaf;\n } });\n})(eo);\nvar oo = {}, no = {};\nObject.defineProperty(no, \"__esModule\", { value: !0 });\nno.isNodeEmpty = Or;\nvar Cr = Ze, Tr = Gt, Sr = ue, Ir = Ge;\nfunction Or(n, e) {\n var t = \"\";\n return (0, Ir.isSingleTag)(n) && !(0, Cr.isLineBreakTag)(n) ? !1 : ((0, Tr.isElement)(n) && (0, Sr.isNativeInput)(n) ? t = n.value : n.textContent !== null && (t = n.textContent.replace(\"\u200B\", \"\")), e !== void 0 && (t = t.replace(new RegExp(e, \"g\"), \"\")), t.trim().length === 0);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isNodeEmpty = void 0;\n var e = no;\n Object.defineProperty(n, \"isNodeEmpty\", { enumerable: !0, get: function() {\n return e.isNodeEmpty;\n } });\n})(oo);\nObject.defineProperty(Jt, \"__esModule\", { value: !0 });\nJt.isEmpty = Ar;\nvar _r = eo, Mr = oo;\nfunction Ar(n, e) {\n n.normalize();\n for (var t = [n]; t.length > 0; ) {\n var o = t.shift();\n if (o) {\n if (n = o, (0, _r.isLeaf)(n) && !(0, Mr.isNodeEmpty)(n, e))\n return !1;\n t.push.apply(t, Array.from(n.childNodes));\n }\n }\n return !0;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isEmpty = void 0;\n var e = Jt;\n Object.defineProperty(n, \"isEmpty\", { enumerable: !0, get: function() {\n return e.isEmpty;\n } });\n})(Cn);\nvar Tn = {}, io = {};\nObject.defineProperty(io, \"__esModule\", { value: !0 });\nio.isFragment = Pr;\nvar Lr = Ht;\nfunction Pr(n) {\n return (0, Lr.isNumber)(n) ? !1 : !!n && !!n.nodeType && n.nodeType === Node.DOCUMENT_FRAGMENT_NODE;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isFragment = void 0;\n var e = io;\n Object.defineProperty(n, \"isFragment\", { enumerable: !0, get: function() {\n return e.isFragment;\n } });\n})(Tn);\nvar Sn = {}, so = {};\nObject.defineProperty(so, \"__esModule\", { value: !0 });\nso.isHTMLString = Rr;\nvar Nr = qe;\nfunction Rr(n) {\n var e = (0, Nr.make)(\"div\");\n return e.innerHTML = n, e.childElementCount > 0;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isHTMLString = void 0;\n var e = so;\n Object.defineProperty(n, \"isHTMLString\", { enumerable: !0, get: function() {\n return e.isHTMLString;\n } });\n})(Sn);\nvar In = {}, ro = {};\nObject.defineProperty(ro, \"__esModule\", { value: !0 });\nro.offset = Dr;\nfunction Dr(n) {\n var e = n.getBoundingClientRect(), t = window.pageXOffset || document.documentElement.scrollLeft, o = window.pageYOffset || document.documentElement.scrollTop, i = e.top + o, s = e.left + t;\n return {\n top: i,\n left: s,\n bottom: i + e.height,\n right: s + e.width\n };\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.offset = void 0;\n var e = ro;\n Object.defineProperty(n, \"offset\", { enumerable: !0, get: function() {\n return e.offset;\n } });\n})(In);\nvar On = {}, ao = {};\nObject.defineProperty(ao, \"__esModule\", { value: !0 });\nao.prepend = Fr;\nfunction Fr(n, e) {\n Array.isArray(e) ? (e = e.reverse(), e.forEach(function(t) {\n return n.prepend(t);\n })) : n.prepend(e);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.prepend = void 0;\n var e = ao;\n Object.defineProperty(n, \"prepend\", { enumerable: !0, get: function() {\n return e.prepend;\n } });\n})(On);\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.prepend = n.offset = n.make = n.isLineBreakTag = n.isSingleTag = n.isNodeEmpty = n.isLeaf = n.isHTMLString = n.isFragment = n.isEmpty = n.isElement = n.isContentEditable = n.isCollapsedWhitespaces = n.findAllInputs = n.isNativeInput = n.allInputsSelector = n.getDeepestNode = n.getDeepestBlockElements = n.getContentLength = n.fragmentToString = n.containsOnlyInlineElements = n.canSetCaret = n.calculateBaseline = n.blockElements = n.append = void 0;\n var e = It;\n Object.defineProperty(n, \"allInputsSelector\", { enumerable: !0, get: function() {\n return e.allInputsSelector;\n } });\n var t = ue;\n Object.defineProperty(n, \"isNativeInput\", { enumerable: !0, get: function() {\n return t.isNativeInput;\n } });\n var o = pn;\n Object.defineProperty(n, \"append\", { enumerable: !0, get: function() {\n return o.append;\n } });\n var i = At;\n Object.defineProperty(n, \"blockElements\", { enumerable: !0, get: function() {\n return i.blockElements;\n } });\n var s = fn;\n Object.defineProperty(n, \"calculateBaseline\", { enumerable: !0, get: function() {\n return s.calculateBaseline;\n } });\n var r = gn;\n Object.defineProperty(n, \"canSetCaret\", { enumerable: !0, get: function() {\n return r.canSetCaret;\n } });\n var a = Ve;\n Object.defineProperty(n, \"containsOnlyInlineElements\", { enumerable: !0, get: function() {\n return a.containsOnlyInlineElements;\n } });\n var l = vn;\n Object.defineProperty(n, \"fragmentToString\", { enumerable: !0, get: function() {\n return l.fragmentToString;\n } });\n var c = kn;\n Object.defineProperty(n, \"getContentLength\", { enumerable: !0, get: function() {\n return c.getContentLength;\n } });\n var u = Wt;\n Object.defineProperty(n, \"getDeepestBlockElements\", { enumerable: !0, get: function() {\n return u.getDeepestBlockElements;\n } });\n var h = wn;\n Object.defineProperty(n, \"getDeepestNode\", { enumerable: !0, get: function() {\n return h.getDeepestNode;\n } });\n var p = xn;\n Object.defineProperty(n, \"findAllInputs\", { enumerable: !0, get: function() {\n return p.findAllInputs;\n } });\n var g = Bn;\n Object.defineProperty(n, \"isCollapsedWhitespaces\", { enumerable: !0, get: function() {\n return g.isCollapsedWhitespaces;\n } });\n var f = Rt;\n Object.defineProperty(n, \"isContentEditable\", { enumerable: !0, get: function() {\n return f.isContentEditable;\n } });\n var v = Gt;\n Object.defineProperty(n, \"isElement\", { enumerable: !0, get: function() {\n return v.isElement;\n } });\n var O = Cn;\n Object.defineProperty(n, \"isEmpty\", { enumerable: !0, get: function() {\n return O.isEmpty;\n } });\n var T = Tn;\n Object.defineProperty(n, \"isFragment\", { enumerable: !0, get: function() {\n return T.isFragment;\n } });\n var M = Sn;\n Object.defineProperty(n, \"isHTMLString\", { enumerable: !0, get: function() {\n return M.isHTMLString;\n } });\n var q = eo;\n Object.defineProperty(n, \"isLeaf\", { enumerable: !0, get: function() {\n return q.isLeaf;\n } });\n var F = oo;\n Object.defineProperty(n, \"isNodeEmpty\", { enumerable: !0, get: function() {\n return F.isNodeEmpty;\n } });\n var H = Ze;\n Object.defineProperty(n, \"isLineBreakTag\", { enumerable: !0, get: function() {\n return H.isLineBreakTag;\n } });\n var Q = Ge;\n Object.defineProperty(n, \"isSingleTag\", { enumerable: !0, get: function() {\n return Q.isSingleTag;\n } });\n var ie = qe;\n Object.defineProperty(n, \"make\", { enumerable: !0, get: function() {\n return ie.make;\n } });\n var k = In;\n Object.defineProperty(n, \"offset\", { enumerable: !0, get: function() {\n return k.offset;\n } });\n var m = On;\n Object.defineProperty(n, \"prepend\", { enumerable: !0, get: function() {\n return m.prepend;\n } });\n})(de);\nvar Qe = {};\nObject.defineProperty(Qe, \"__esModule\", { value: !0 });\nQe.getContenteditableSlice = Hr;\nvar jr = de;\nfunction Hr(n, e, t, o, i) {\n var s;\n i === void 0 && (i = !1);\n var r = document.createRange();\n if (o === \"left\" ? (r.setStart(n, 0), r.setEnd(e, t)) : (r.setStart(e, t), r.setEnd(n, n.childNodes.length)), i === !0) {\n var a = r.extractContents();\n return (0, jr.fragmentToString)(a);\n }\n var l = r.cloneContents(), c = document.createElement(\"div\");\n c.appendChild(l);\n var u = (s = c.textContent) !== null && s !== void 0 ? s : \"\";\n return u;\n}\nObject.defineProperty(Xe, \"__esModule\", { value: !0 });\nXe.checkContenteditableSliceForEmptiness = Ur;\nvar $r = de, zr = Qe;\nfunction Ur(n, e, t, o) {\n var i = (0, zr.getContenteditableSlice)(n, e, t, o);\n return (0, $r.isCollapsedWhitespaces)(i);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.checkContenteditableSliceForEmptiness = void 0;\n var e = Xe;\n Object.defineProperty(n, \"checkContenteditableSliceForEmptiness\", { enumerable: !0, get: function() {\n return e.checkContenteditableSliceForEmptiness;\n } });\n})(St);\nvar _n = {};\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.getContenteditableSlice = void 0;\n var e = Qe;\n Object.defineProperty(n, \"getContenteditableSlice\", { enumerable: !0, get: function() {\n return e.getContenteditableSlice;\n } });\n})(_n);\nvar Mn = {}, lo = {};\nObject.defineProperty(lo, \"__esModule\", { value: !0 });\nlo.focus = Yr;\nvar Wr = de;\nfunction Yr(n, e) {\n var t, o;\n if (e === void 0 && (e = !0), (0, Wr.isNativeInput)(n)) {\n n.focus();\n var i = e ? 0 : n.value.length;\n n.setSelectionRange(i, i);\n } else {\n var s = document.createRange(), r = window.getSelection();\n if (!r)\n return;\n var a = function(p) {\n var g = document.createTextNode(\"\");\n p.appendChild(g), s.setStart(g, 0), s.setEnd(g, 0);\n }, l = function(p) {\n return p != null;\n }, c = n.childNodes, u = e ? c[0] : c[c.length - 1];\n if (l(u)) {\n for (; l(u) && u.nodeType !== Node.TEXT_NODE; )\n u = e ? u.firstChild : u.lastChild;\n if (l(u) && u.nodeType === Node.TEXT_NODE) {\n var h = (o = (t = u.textContent) === null || t === void 0 ? void 0 : t.length) !== null && o !== void 0 ? o : 0, i = e ? 0 : h;\n s.setStart(u, i), s.setEnd(u, i);\n } else\n a(n);\n } else\n a(n);\n r.removeAllRanges(), r.addRange(s);\n }\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.focus = void 0;\n var e = lo;\n Object.defineProperty(n, \"focus\", { enumerable: !0, get: function() {\n return e.focus;\n } });\n})(Mn);\nvar co = {}, Je = {};\nObject.defineProperty(Je, \"__esModule\", { value: !0 });\nJe.getCaretNodeAndOffset = Kr;\nfunction Kr() {\n var n = window.getSelection();\n if (n === null)\n return [null, 0];\n var e = n.focusNode, t = n.focusOffset;\n return e === null ? [null, 0] : (e.nodeType !== Node.TEXT_NODE && e.childNodes.length > 0 && (e.childNodes[t] !== void 0 ? (e = e.childNodes[t], t = 0) : (e = e.childNodes[t - 1], e.textContent !== null && (t = e.textContent.length))), [e, t]);\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.getCaretNodeAndOffset = void 0;\n var e = Je;\n Object.defineProperty(n, \"getCaretNodeAndOffset\", { enumerable: !0, get: function() {\n return e.getCaretNodeAndOffset;\n } });\n})(co);\nvar An = {}, et = {};\nObject.defineProperty(et, \"__esModule\", { value: !0 });\net.getRange = Xr;\nfunction Xr() {\n var n = window.getSelection();\n return n && n.rangeCount ? n.getRangeAt(0) : null;\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.getRange = void 0;\n var e = et;\n Object.defineProperty(n, \"getRange\", { enumerable: !0, get: function() {\n return e.getRange;\n } });\n})(An);\nvar Ln = {}, uo = {};\nObject.defineProperty(uo, \"__esModule\", { value: !0 });\nuo.isCaretAtEndOfInput = Zr;\nvar Oo = de, Vr = co, qr = St;\nfunction Zr(n) {\n var e = (0, Oo.getDeepestNode)(n, !0);\n if (e === null)\n return !0;\n if ((0, Oo.isNativeInput)(e))\n return e.selectionEnd === e.value.length;\n var t = (0, Vr.getCaretNodeAndOffset)(), o = t[0], i = t[1];\n return o === null ? !1 : (0, qr.checkContenteditableSliceForEmptiness)(n, o, i, \"right\");\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isCaretAtEndOfInput = void 0;\n var e = uo;\n Object.defineProperty(n, \"isCaretAtEndOfInput\", { enumerable: !0, get: function() {\n return e.isCaretAtEndOfInput;\n } });\n})(Ln);\nvar Pn = {}, ho = {};\nObject.defineProperty(ho, \"__esModule\", { value: !0 });\nho.isCaretAtStartOfInput = Jr;\nvar Ae = de, Gr = Je, Qr = Xe;\nfunction Jr(n) {\n var e = (0, Ae.getDeepestNode)(n);\n if (e === null || (0, Ae.isEmpty)(n))\n return !0;\n if ((0, Ae.isNativeInput)(e))\n return e.selectionEnd === 0;\n if ((0, Ae.isEmpty)(n))\n return !0;\n var t = (0, Gr.getCaretNodeAndOffset)(), o = t[0], i = t[1];\n return o === null ? !1 : (0, Qr.checkContenteditableSliceForEmptiness)(n, o, i, \"left\");\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.isCaretAtStartOfInput = void 0;\n var e = ho;\n Object.defineProperty(n, \"isCaretAtStartOfInput\", { enumerable: !0, get: function() {\n return e.isCaretAtStartOfInput;\n } });\n})(Pn);\nvar Nn = {}, po = {};\nObject.defineProperty(po, \"__esModule\", { value: !0 });\npo.save = oa;\nvar ea = de, ta = et;\nfunction oa() {\n var n = (0, ta.getRange)(), e = (0, ea.make)(\"span\");\n if (e.id = \"cursor\", e.hidden = !0, !!n)\n return n.insertNode(e), function() {\n var o = window.getSelection();\n o && (n.setStartAfter(e), n.setEndAfter(e), o.removeAllRanges(), o.addRange(n), setTimeout(function() {\n e.remove();\n }, 150));\n };\n}\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.save = void 0;\n var e = po;\n Object.defineProperty(n, \"save\", { enumerable: !0, get: function() {\n return e.save;\n } });\n})(Nn);\n(function(n) {\n Object.defineProperty(n, \"__esModule\", { value: !0 }), n.save = n.isCaretAtStartOfInput = n.isCaretAtEndOfInput = n.getRange = n.getCaretNodeAndOffset = n.focus = n.getContenteditableSlice = n.checkContenteditableSliceForEmptiness = void 0;\n var e = St;\n Object.defineProperty(n, \"checkContenteditableSliceForEmptiness\", { enumerable: !0, get: function() {\n return e.checkContenteditableSliceForEmptiness;\n } });\n var t = _n;\n Object.defineProperty(n, \"getContenteditableSlice\", { enumerable: !0, get: function() {\n return t.getContenteditableSlice;\n } });\n var o = Mn;\n Object.defineProperty(n, \"focus\", { enumerable: !0, get: function() {\n return o.focus;\n } });\n var i = co;\n Object.defineProperty(n, \"getCaretNodeAndOffset\", { enumerable: !0, get: function() {\n return i.getCaretNodeAndOffset;\n } });\n var s = An;\n Object.defineProperty(n, \"getRange\", { enumerable: !0, get: function() {\n return s.getRange;\n } });\n var r = Ln;\n Object.defineProperty(n, \"isCaretAtEndOfInput\", { enumerable: !0, get: function() {\n return r.isCaretAtEndOfInput;\n } });\n var a = Pn;\n Object.defineProperty(n, \"isCaretAtStartOfInput\", { enumerable: !0, get: function() {\n return a.isCaretAtStartOfInput;\n } });\n var l = Nn;\n Object.defineProperty(n, \"save\", { enumerable: !0, get: function() {\n return l.save;\n } });\n})(hn);\nclass na extends E {\n /**\n * All keydowns on Block\n *\n * @param {KeyboardEvent} event - keydown\n */\n keydown(e) {\n switch (this.beforeKeydownProcessing(e), e.keyCode) {\n case y.BACKSPACE:\n this.backspace(e);\n break;\n case y.DELETE:\n this.delete(e);\n break;\n case y.ENTER:\n this.enter(e);\n break;\n case y.DOWN:\n case y.RIGHT:\n this.arrowRightAndDown(e);\n break;\n case y.UP:\n case y.LEFT:\n this.arrowLeftAndUp(e);\n break;\n case y.TAB:\n this.tabPressed(e);\n break;\n }\n e.key === \"/\" && !e.ctrlKey && !e.metaKey && this.slashPressed(e), e.code === \"Slash\" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), this.commandSlashPressed());\n }\n /**\n * Fires on keydown before event processing\n *\n * @param {KeyboardEvent} event - keydown\n */\n beforeKeydownProcessing(e) {\n this.needToolbarClosing(e) && Po(e.keyCode) && (this.Editor.Toolbar.close(), e.ctrlKey || e.metaKey || e.altKey || e.shiftKey || this.Editor.BlockSelection.clearSelection(e));\n }\n /**\n * Key up on Block:\n * - shows Inline Toolbar if something selected\n * - shows conversion toolbar with 85% of block selection\n *\n * @param {KeyboardEvent} event - keyup event\n */\n keyup(e) {\n e.shiftKey || this.Editor.UI.checkEmptiness();\n }\n /**\n * Add drop target styles\n *\n * @param {DragEvent} event - drag over event\n */\n dragOver(e) {\n const t = this.Editor.BlockManager.getBlockByChildNode(e.target);\n t.dropTarget = !0;\n }\n /**\n * Remove drop target style\n *\n * @param {DragEvent} event - drag leave event\n */\n dragLeave(e) {\n const t = this.Editor.BlockManager.getBlockByChildNode(e.target);\n t.dropTarget = !1;\n }\n /**\n * Copying selected blocks\n * Before putting to the clipboard we sanitize all blocks and then copy to the clipboard\n *\n * @param {ClipboardEvent} event - clipboard event\n */\n handleCommandC(e) {\n const { BlockSelection: t } = this.Editor;\n t.anyBlockSelected && t.copySelectedBlocks(e);\n }\n /**\n * Copy and Delete selected Blocks\n *\n * @param {ClipboardEvent} event - clipboard event\n */\n handleCommandX(e) {\n const { BlockSelection: t, BlockManager: o, Caret: i } = this.Editor;\n t.anyBlockSelected && t.copySelectedBlocks(e).then(() => {\n const s = o.removeSelectedBlocks(), r = o.insertDefaultBlockAtIndex(s, !0);\n i.setToBlock(r, i.positions.START), t.clearSelection(e);\n });\n }\n /**\n * Tab pressed inside a Block.\n *\n * @param {KeyboardEvent} event - keydown\n */\n tabPressed(e) {\n const { InlineToolbar: t, Caret: o } = this.Editor;\n if (t.opened)\n return;\n (e.shiftKey ? o.navigatePrevious(!0) : o.navigateNext(!0)) && e.preventDefault();\n }\n /**\n * '/' + 'command' keydown inside a Block\n */\n commandSlashPressed() {\n this.Editor.BlockSelection.selectedBlocks.length > 1 || this.activateBlockSettings();\n }\n /**\n * '/' keydown inside a Block\n *\n * @param event - keydown\n */\n slashPressed(e) {\n this.Editor.BlockManager.currentBlock.isEmpty && (e.preventDefault(), this.Editor.Caret.insertContentAtCaretPosition(\"/\"), this.activateToolbox());\n }\n /**\n * ENTER pressed on block\n *\n * @param {KeyboardEvent} event - keydown\n */\n enter(e) {\n const { BlockManager: t, UI: o } = this.Editor, i = t.currentBlock;\n if (i === void 0 || i.tool.isLineBreaksEnabled || o.someToolbarOpened && o.someFlipperButtonFocused || e.shiftKey && !pt)\n return;\n let s = i;\n i.currentInput !== void 0 && Ne(i.currentInput) && !i.hasMedia ? this.Editor.BlockManager.insertDefaultBlockAtIndex(this.Editor.BlockManager.currentBlockIndex) : i.currentInput && Re(i.currentInput) ? s = this.Editor.BlockManager.insertDefaultBlockAtIndex(this.Editor.BlockManager.currentBlockIndex + 1) : s = this.Editor.BlockManager.split(), this.Editor.Caret.setToBlock(s), this.Editor.Toolbar.moveAndOpen(s), e.preventDefault();\n }\n /**\n * Handle backspace keydown on Block\n *\n * @param {KeyboardEvent} event - keydown\n */\n backspace(e) {\n const { BlockManager: t, Caret: o } = this.Editor, { currentBlock: i, previousBlock: s } = t;\n if (i === void 0 || !b.isCollapsed || !i.currentInput || !Ne(i.currentInput))\n return;\n if (e.preventDefault(), this.Editor.Toolbar.close(), !(i.currentInput === i.firstInput)) {\n o.navigatePrevious();\n return;\n }\n if (s === null)\n return;\n if (s.isEmpty) {\n t.removeBlock(s);\n return;\n }\n if (i.isEmpty) {\n t.removeBlock(i);\n const l = t.currentBlock;\n o.setToBlock(l, o.positions.END);\n return;\n }\n xo(s, i) ? this.mergeBlocks(s, i) : o.setToBlock(s, o.positions.END);\n }\n /**\n * Handles delete keydown on Block\n * Removes char after the caret.\n * If caret is at the end of the block, merge next block with current\n *\n * @param {KeyboardEvent} event - keydown\n */\n delete(e) {\n const { BlockManager: t, Caret: o } = this.Editor, { currentBlock: i, nextBlock: s } = t;\n if (!b.isCollapsed || !Re(i.currentInput))\n return;\n if (e.preventDefault(), this.Editor.Toolbar.close(), !(i.currentInput === i.lastInput)) {\n o.navigateNext();\n return;\n }\n if (s === null)\n return;\n if (s.isEmpty) {\n t.removeBlock(s);\n return;\n }\n if (i.isEmpty) {\n t.removeBlock(i), o.setToBlock(s, o.positions.START);\n return;\n }\n xo(i, s) ? this.mergeBlocks(i, s) : o.setToBlock(s, o.positions.START);\n }\n /**\n * Merge passed Blocks\n *\n * @param targetBlock - to which Block we want to merge\n * @param blockToMerge - what Block we want to merge\n */\n mergeBlocks(e, t) {\n const { BlockManager: o, Toolbar: i } = this.Editor;\n e.lastInput !== void 0 && (hn.focus(e.lastInput, !1), o.mergeBlocks(e, t).then(() => {\n i.close();\n }));\n }\n /**\n * Handle right and down keyboard keys\n *\n * @param {KeyboardEvent} event - keyboard event\n */\n arrowRightAndDown(e) {\n const t = ce.usedKeys.includes(e.keyCode) && (!e.shiftKey || e.keyCode === y.TAB);\n if (this.Editor.UI.someToolbarOpened && t)\n return;\n this.Editor.Toolbar.close();\n const { currentBlock: o } = this.Editor.BlockManager, s = ((o == null ? void 0 : o.currentInput) !== void 0 ? Re(o.currentInput) : void 0) || this.Editor.BlockSelection.anyBlockSelected;\n if (e.shiftKey && e.keyCode === y.DOWN && s) {\n this.Editor.CrossBlockSelection.toggleBlockSelectedState();\n return;\n }\n if (e.keyCode === y.DOWN || e.keyCode === y.RIGHT && !this.isRtl ? this.Editor.Caret.navigateNext() : this.Editor.Caret.navigatePrevious()) {\n e.preventDefault();\n return;\n }\n Fe(() => {\n this.Editor.BlockManager.currentBlock && this.Editor.BlockManager.currentBlock.updateCurrentInput();\n }, 20)(), this.Editor.BlockSelection.clearSelection(e);\n }\n /**\n * Handle left and up keyboard keys\n *\n * @param {KeyboardEvent} event - keyboard event\n */\n arrowLeftAndUp(e) {\n if (this.Editor.UI.someToolbarOpened) {\n if (ce.usedKeys.includes(e.keyCode) && (!e.shiftKey || e.keyCode === y.TAB))\n return;\n this.Editor.UI.closeAllToolbars();\n }\n this.Editor.Toolbar.close();\n const { currentBlock: t } = this.Editor.BlockManager, i = ((t == null ? void 0 : t.currentInput) !== void 0 ? Ne(t.currentInput) : void 0) || this.Editor.BlockSelection.anyBlockSelected;\n if (e.shiftKey && e.keyCode === y.UP && i) {\n this.Editor.CrossBlockSelection.toggleBlockSelectedState(!1);\n return;\n }\n if (e.keyCode === y.UP || e.keyCode === y.LEFT && !this.isRtl ? this.Editor.Caret.navigatePrevious() : this.Editor.Caret.navigateNext()) {\n e.preventDefault();\n return;\n }\n Fe(() => {\n this.Editor.BlockManager.currentBlock && this.Editor.BlockManager.currentBlock.updateCurrentInput();\n }, 20)(), this.Editor.BlockSelection.clearSelection(e);\n }\n /**\n * Cases when we need to close Toolbar\n *\n * @param {KeyboardEvent} event - keyboard event\n */\n needToolbarClosing(e) {\n const t = e.keyCode === y.ENTER && this.Editor.Toolbar.toolbox.opened, o = e.keyCode === y.ENTER && this.Editor.BlockSettings.opened, i = e.keyCode === y.ENTER && this.Editor.InlineToolbar.opened, s = e.keyCode === y.TAB;\n return !(e.shiftKey || s || t || o || i);\n }\n /**\n * If Toolbox is not open, then just open it and show plus button\n */\n activateToolbox() {\n this.Editor.Toolbar.opened || this.Editor.Toolbar.moveAndOpen(), this.Editor.Toolbar.toolbox.open();\n }\n /**\n * Open Toolbar and show BlockSettings before flipping Tools\n */\n activateBlockSettings() {\n this.Editor.Toolbar.opened || this.Editor.Toolbar.moveAndOpen(), this.Editor.BlockSettings.opened || this.Editor.BlockSettings.open();\n }\n}\nclass ct {\n /**\n * @class\n * @param {HTMLElement} workingArea \u2014 editor`s working node\n */\n constructor(e) {\n this.blocks = [], this.workingArea = e;\n }\n /**\n * Get length of Block instances array\n *\n * @returns {number}\n */\n get length() {\n return this.blocks.length;\n }\n /**\n * Get Block instances array\n *\n * @returns {Block[]}\n */\n get array() {\n return this.blocks;\n }\n /**\n * Get blocks html elements array\n *\n * @returns {HTMLElement[]}\n */\n get nodes() {\n return No(this.workingArea.children);\n }\n /**\n * Proxy trap to implement array-like setter\n *\n * @example\n * blocks[0] = new Block(...)\n * @param {Blocks} instance \u2014 Blocks instance\n * @param {PropertyKey} property \u2014 block index or any Blocks class property key to set\n * @param {Block} value \u2014 value to set\n * @returns {boolean}\n */\n static set(e, t, o) {\n return isNaN(Number(t)) ? (Reflect.set(e, t, o), !0) : (e.insert(+t, o), !0);\n }\n /**\n * Proxy trap to implement array-like getter\n *\n * @param {Blocks} instance \u2014 Blocks instance\n * @param {PropertyKey} property \u2014 Blocks class property key\n * @returns {Block|*}\n */\n static get(e, t) {\n return isNaN(Number(t)) ? Reflect.get(e, t) : e.get(+t);\n }\n /**\n * Push new Block to the blocks array and append it to working area\n *\n * @param {Block} block - Block to add\n */\n push(e) {\n this.blocks.push(e), this.insertToDOM(e);\n }\n /**\n * Swaps blocks with indexes first and second\n *\n * @param {number} first - first block index\n * @param {number} second - second block index\n * @deprecated \u2014 use 'move' instead\n */\n swap(e, t) {\n const o = this.blocks[t];\n d.swap(this.blocks[e].holder, o.holder), this.blocks[t] = this.blocks[e], this.blocks[e] = o;\n }\n /**\n * Move a block from one to another index\n *\n * @param {number} toIndex - new index of the block\n * @param {number} fromIndex - block to move\n */\n move(e, t) {\n const o = this.blocks.splice(t, 1)[0], i = e - 1, s = Math.max(0, i), r = this.blocks[s];\n e > 0 ? this.insertToDOM(o, \"afterend\", r) : this.insertToDOM(o, \"beforebegin\", r), this.blocks.splice(e, 0, o);\n const a = this.composeBlockEvent(\"move\", {\n fromIndex: t,\n toIndex: e\n });\n o.call(ee.MOVED, a);\n }\n /**\n * Insert new Block at passed index\n *\n * @param {number} index \u2014 index to insert Block\n * @param {Block} block \u2014 Block to insert\n * @param {boolean} replace \u2014 it true, replace block on given index\n */\n insert(e, t, o = !1) {\n if (!this.length) {\n this.push(t);\n return;\n }\n e > this.length && (e = this.length), o && (this.blocks[e].holder.remove(), this.blocks[e].call(ee.REMOVED));\n const i = o ? 1 : 0;\n if (this.blocks.splice(e, i, t), e > 0) {\n const s = this.blocks[e - 1];\n this.insertToDOM(t, \"afterend\", s);\n } else {\n const s = this.blocks[e + 1];\n s ? this.insertToDOM(t, \"beforebegin\", s) : this.insertToDOM(t);\n }\n }\n /**\n * Replaces block under passed index with passed block\n *\n * @param index - index of existed block\n * @param block - new block\n */\n replace(e, t) {\n if (this.blocks[e] === void 0)\n throw Error(\"Incorrect index\");\n this.blocks[e].holder.replaceWith(t.holder), this.blocks[e] = t;\n }\n /**\n * Inserts several blocks at once\n *\n * @param blocks - blocks to insert\n * @param index - index to insert blocks at\n */\n insertMany(e, t) {\n const o = new DocumentFragment();\n for (const i of e)\n o.appendChild(i.holder);\n if (this.length > 0) {\n if (t > 0) {\n const i = Math.min(t - 1, this.length - 1);\n this.blocks[i].holder.after(o);\n } else\n t === 0 && this.workingArea.prepend(o);\n this.blocks.splice(t, 0, ...e);\n } else\n this.blocks.push(...e), this.workingArea.appendChild(o);\n e.forEach((i) => i.call(ee.RENDERED));\n }\n /**\n * Remove block\n *\n * @param {number} index - index of Block to remove\n */\n remove(e) {\n isNaN(e) && (e = this.length - 1), this.blocks[e].holder.remove(), this.blocks[e].call(ee.REMOVED), this.blocks.splice(e, 1);\n }\n /**\n * Remove all blocks\n */\n removeAll() {\n this.workingArea.innerHTML = \"\", this.blocks.forEach((e) => e.call(ee.REMOVED)), this.blocks.length = 0;\n }\n /**\n * Insert Block after passed target\n *\n * @todo decide if this method is necessary\n * @param {Block} targetBlock \u2014 target after which Block should be inserted\n * @param {Block} newBlock \u2014 Block to insert\n */\n insertAfter(e, t) {\n const o = this.blocks.indexOf(e);\n this.insert(o + 1, t);\n }\n /**\n * Get Block by index\n *\n * @param {number} index \u2014 Block index\n * @returns {Block}\n */\n get(e) {\n return this.blocks[e];\n }\n /**\n * Return index of passed Block\n *\n * @param {Block} block - Block to find\n * @returns {number}\n */\n indexOf(e) {\n return this.blocks.indexOf(e);\n }\n /**\n * Insert new Block into DOM\n *\n * @param {Block} block - Block to insert\n * @param {InsertPosition} position \u2014 insert position (if set, will use insertAdjacentElement)\n * @param {Block} target \u2014 Block related to position\n */\n insertToDOM(e, t, o) {\n t ? o.holder.insertAdjacentElement(t, e.holder) : this.workingArea.appendChild(e.holder), e.call(ee.RENDERED);\n }\n /**\n * Composes Block event with passed type and details\n *\n * @param {string} type - event type\n * @param {object} detail - event detail\n */\n composeBlockEvent(e, t) {\n return new CustomEvent(e, {\n detail: t\n });\n }\n}\nconst _o = \"block-removed\", Mo = \"block-added\", ia = \"block-moved\", Ao = \"block-changed\";\nclass sa {\n constructor() {\n this.completed = Promise.resolve();\n }\n /**\n * Add new promise to queue\n *\n * @param operation - promise should be added to queue\n */\n add(e) {\n return new Promise((t, o) => {\n this.completed = this.completed.then(e).then(t).catch(o);\n });\n }\n}\nclass ra extends E {\n constructor() {\n super(...arguments), this._currentBlockIndex = -1, this._blocks = null;\n }\n /**\n * Returns current Block index\n *\n * @returns {number}\n */\n get currentBlockIndex() {\n return this._currentBlockIndex;\n }\n /**\n * Set current Block index and fire Block lifecycle callbacks\n *\n * @param {number} newIndex - index of Block to set as current\n */\n set currentBlockIndex(e) {\n this._currentBlockIndex = e;\n }\n /**\n * returns first Block\n *\n * @returns {Block}\n */\n get firstBlock() {\n return this._blocks[0];\n }\n /**\n * returns last Block\n *\n * @returns {Block}\n */\n get lastBlock() {\n return this._blocks[this._blocks.length - 1];\n }\n /**\n * Get current Block instance\n *\n * @returns {Block}\n */\n get currentBlock() {\n return this._blocks[this.currentBlockIndex];\n }\n /**\n * Set passed Block as a current\n *\n * @param block - block to set as a current\n */\n set currentBlock(e) {\n this.currentBlockIndex = this.getBlockIndex(e);\n }\n /**\n * Returns next Block instance\n *\n * @returns {Block|null}\n */\n get nextBlock() {\n return this.currentBlockIndex === this._blocks.length - 1 ? null : this._blocks[this.currentBlockIndex + 1];\n }\n /**\n * Return first Block with inputs after current Block\n *\n * @returns {Block | undefined}\n */\n get nextContentfulBlock() {\n return this.blocks.slice(this.currentBlockIndex + 1).find((t) => !!t.inputs.length);\n }\n /**\n * Return first Block with inputs before current Block\n *\n * @returns {Block | undefined}\n */\n get previousContentfulBlock() {\n return this.blocks.slice(0, this.currentBlockIndex).reverse().find((t) => !!t.inputs.length);\n }\n /**\n * Returns previous Block instance\n *\n * @returns {Block|null}\n */\n get previousBlock() {\n return this.currentBlockIndex === 0 ? null : this._blocks[this.currentBlockIndex - 1];\n }\n /**\n * Get array of Block instances\n *\n * @returns {Block[]} {@link Blocks#array}\n */\n get blocks() {\n return this._blocks.array;\n }\n /**\n * Check if each Block is empty\n *\n * @returns {boolean}\n */\n get isEditorEmpty() {\n return this.blocks.every((e) => e.isEmpty);\n }\n /**\n * Should be called after Editor.UI preparation\n * Define this._blocks property\n */\n prepare() {\n const e = new ct(this.Editor.UI.nodes.redactor);\n this._blocks = new Proxy(e, {\n set: ct.set,\n get: ct.get\n }), this.listeners.on(\n document,\n \"copy\",\n (t) => this.Editor.BlockEvents.handleCommandC(t)\n );\n }\n /**\n * Toggle read-only state\n *\n * If readOnly is true:\n * - Unbind event handlers from created Blocks\n *\n * if readOnly is false:\n * - Bind event handlers to all existing Blocks\n *\n * @param {boolean} readOnlyEnabled - \"read only\" state\n */\n toggleReadOnly(e) {\n e ? this.disableModuleBindings() : this.enableModuleBindings();\n }\n /**\n * Creates Block instance by tool name\n *\n * @param {object} options - block creation options\n * @param {string} options.tool - tools passed in editor config {@link EditorConfig#tools}\n * @param {string} [options.id] - unique id for this block\n * @param {BlockToolData} [options.data] - constructor params\n * @returns {Block}\n */\n composeBlock({\n tool: e,\n data: t = {},\n id: o = void 0,\n tunes: i = {}\n }) {\n const s = this.Editor.ReadOnly.isEnabled, r = this.Editor.Tools.blockTools.get(e), a = new R({\n id: o,\n data: t,\n tool: r,\n api: this.Editor.API,\n readOnly: s,\n tunesData: i\n }, this.eventsDispatcher);\n return s || window.requestIdleCallback(() => {\n this.bindBlockEvents(a);\n }, { timeout: 2e3 }), a;\n }\n /**\n * Insert new block into _blocks\n *\n * @param {object} options - insert options\n * @param {string} [options.id] - block's unique id\n * @param {string} [options.tool] - plugin name, by default method inserts the default block type\n * @param {object} [options.data] - plugin data\n * @param {number} [options.index] - index where to insert new Block\n * @param {boolean} [options.needToFocus] - flag shows if needed to update current Block index\n * @param {boolean} [options.replace] - flag shows if block by passed index should be replaced with inserted one\n * @returns {Block}\n */\n insert({\n id: e = void 0,\n tool: t = this.config.defaultBlock,\n data: o = {},\n index: i,\n needToFocus: s = !0,\n replace: r = !1,\n tunes: a = {}\n } = {}) {\n let l = i;\n l === void 0 && (l = this.currentBlockIndex + (r ? 0 : 1));\n const c = this.composeBlock({\n id: e,\n tool: t,\n data: o,\n tunes: a\n });\n return r && this.blockDidMutated(_o, this.getBlockByIndex(l), {\n index: l\n }), this._blocks.insert(l, c, r), this.blockDidMutated(Mo, c, {\n index: l\n }), s ? this.currentBlockIndex = l : l <= this.currentBlockIndex && this.currentBlockIndex++, c;\n }\n /**\n * Inserts several blocks at once\n *\n * @param blocks - blocks to insert\n * @param index - index where to insert\n */\n insertMany(e, t = 0) {\n this._blocks.insertMany(e, t);\n }\n /**\n * Update Block data.\n *\n * Currently we don't have an 'update' method in the Tools API, so we just create a new block with the same id and type\n * Should not trigger 'block-removed' or 'block-added' events.\n *\n * If neither data nor tunes is provided, return the provided block instead.\n *\n * @param block - block to update\n * @param data - (optional) new data\n * @param tunes - (optional) tune data\n */\n async update(e, t, o) {\n if (!t && !o)\n return e;\n const i = await e.data, s = this.composeBlock({\n id: e.id,\n tool: e.name,\n data: Object.assign({}, i, t ?? {}),\n tunes: o ?? e.tunes\n }), r = this.getBlockIndex(e);\n return this._blocks.replace(r, s), this.blockDidMutated(Ao, s, {\n index: r\n }), s;\n }\n /**\n * Replace passed Block with the new one with specified Tool and data\n *\n * @param block - block to replace\n * @param newTool - new Tool name\n * @param data - new Tool data\n */\n replace(e, t, o) {\n const i = this.getBlockIndex(e);\n return this.insert({\n tool: t,\n data: o,\n index: i,\n replace: !0\n });\n }\n /**\n * Insert pasted content. Call onPaste callback after insert.\n *\n * @param {string} toolName - name of Tool to insert\n * @param {PasteEvent} pasteEvent - pasted data\n * @param {boolean} replace - should replace current block\n */\n paste(e, t, o = !1) {\n const i = this.insert({\n tool: e,\n replace: o\n });\n try {\n window.requestIdleCallback(() => {\n i.call(ee.ON_PASTE, t);\n });\n } catch (s) {\n S(`${e}: onPaste callback call is failed`, \"error\", s);\n }\n return i;\n }\n /**\n * Insert new default block at passed index\n *\n * @param {number} index - index where Block should be inserted\n * @param {boolean} needToFocus - if true, updates current Block index\n *\n * TODO: Remove method and use insert() with index instead (?)\n * @returns {Block} inserted Block\n */\n insertDefaultBlockAtIndex(e, t = !1) {\n const o = this.composeBlock({ tool: this.config.defaultBlock });\n return this._blocks[e] = o, this.blockDidMutated(Mo, o, {\n index: e\n }), t ? this.currentBlockIndex = e : e <= this.currentBlockIndex && this.currentBlockIndex++, o;\n }\n /**\n * Always inserts at the end\n *\n * @returns {Block}\n */\n insertAtEnd() {\n return this.currentBlockIndex = this.blocks.length - 1, this.insert();\n }\n /**\n * Merge two blocks\n *\n * @param {Block} targetBlock - previous block will be append to this block\n * @param {Block} blockToMerge - block that will be merged with target block\n * @returns {Promise} - the sequence that can be continued\n */\n async mergeBlocks(e, t) {\n let o;\n if (e.name === t.name && e.mergeable) {\n const i = await t.data;\n if (V(i)) {\n console.error(\"Could not merge Block. Failed to extract original Block data.\");\n return;\n }\n const [s] = yt([i], e.tool.sanitizeConfig);\n o = s;\n } else if (e.mergeable && He(t, \"export\") && He(e, \"import\")) {\n const i = await t.exportDataAsString(), s = Z(i, e.tool.sanitizeConfig);\n o = Bo(s, e.tool.conversionConfig);\n }\n o !== void 0 && (await e.mergeWith(o), this.removeBlock(t), this.currentBlockIndex = this._blocks.indexOf(e));\n }\n /**\n * Remove passed Block\n *\n * @param block - Block to remove\n * @param addLastBlock - if true, adds new default block at the end. @todo remove this logic and use event-bus instead\n */\n removeBlock(e, t = !0) {\n return new Promise((o) => {\n const i = this._blocks.indexOf(e);\n if (!this.validateIndex(i))\n throw new Error(\"Can't find a Block to remove\");\n e.destroy(), this._blocks.remove(i), this.blockDidMutated(_o, e, {\n index: i\n }), this.currentBlockIndex >= i && this.currentBlockIndex--, this.blocks.length ? i === 0 && (this.currentBlockIndex = 0) : (this.unsetCurrentBlock(), t && this.insert()), o();\n });\n }\n /**\n * Remove only selected Blocks\n * and returns first Block index where started removing...\n *\n * @returns {number|undefined}\n */\n removeSelectedBlocks() {\n let e;\n for (let t = this.blocks.length - 1; t >= 0; t--)\n this.blocks[t].selected && (this.removeBlock(this.blocks[t]), e = t);\n return e;\n }\n /**\n * Attention!\n * After removing insert the new default typed Block and focus on it\n * Removes all blocks\n */\n removeAllBlocks() {\n for (let e = this.blocks.length - 1; e >= 0; e--)\n this._blocks.remove(e);\n this.unsetCurrentBlock(), this.insert(), this.currentBlock.firstInput.focus();\n }\n /**\n * Split current Block\n * 1. Extract content from Caret position to the Block`s end\n * 2. Insert a new Block below current one with extracted content\n *\n * @returns {Block}\n */\n split() {\n const e = this.Editor.Caret.extractFragmentFromCaretPosition(), t = d.make(\"div\");\n t.appendChild(e);\n const o = {\n text: d.isEmpty(t) ? \"\" : t.innerHTML\n };\n return this.insert({ data: o });\n }\n /**\n * Returns Block by passed index\n *\n * @param {number} index - index to get. -1 to get last\n * @returns {Block}\n */\n getBlockByIndex(e) {\n return e === -1 && (e = this._blocks.length - 1), this._blocks[e];\n }\n /**\n * Returns an index for passed Block\n *\n * @param block - block to find index\n */\n getBlockIndex(e) {\n return this._blocks.indexOf(e);\n }\n /**\n * Returns the Block by passed id\n *\n * @param id - id of block to get\n * @returns {Block}\n */\n getBlockById(e) {\n return this._blocks.array.find((t) => t.id === e);\n }\n /**\n * Get Block instance by html element\n *\n * @param {Node} element - html element to get Block by\n */\n getBlock(e) {\n d.isElement(e) || (e = e.parentNode);\n const t = this._blocks.nodes, o = e.closest(`.${R.CSS.wrapper}`), i = t.indexOf(o);\n if (i >= 0)\n return this._blocks[i];\n }\n /**\n * 1) Find first-level Block from passed child Node\n * 2) Mark it as current\n *\n * @param {Node} childNode - look ahead from this node.\n * @returns {Block | undefined} can return undefined in case when the passed child note is not a part of the current editor instance\n */\n setCurrentBlockByChildNode(e) {\n d.isElement(e) || (e = e.parentNode);\n const t = e.closest(`.${R.CSS.wrapper}`);\n if (!t)\n return;\n const o = t.closest(`.${this.Editor.UI.CSS.editorWrapper}`);\n if (o != null && o.isEqualNode(this.Editor.UI.nodes.wrapper))\n return this.currentBlockIndex = this._blocks.nodes.indexOf(t), this.currentBlock.updateCurrentInput(), this.currentBlock;\n }\n /**\n * Return block which contents passed node\n *\n * @param {Node} childNode - node to get Block by\n * @returns {Block}\n */\n getBlockByChildNode(e) {\n if (!e || !(e instanceof Node))\n return;\n d.isElement(e) || (e = e.parentNode);\n const t = e.closest(`.${R.CSS.wrapper}`);\n return this.blocks.find((o) => o.holder === t);\n }\n /**\n * Swap Blocks Position\n *\n * @param {number} fromIndex - index of first block\n * @param {number} toIndex - index of second block\n * @deprecated \u2014 use 'move' instead\n */\n swap(e, t) {\n this._blocks.swap(e, t), this.currentBlockIndex = t;\n }\n /**\n * Move a block to a new index\n *\n * @param {number} toIndex - index where to move Block\n * @param {number} fromIndex - index of Block to move\n */\n move(e, t = this.currentBlockIndex) {\n if (isNaN(e) || isNaN(t)) {\n S(\"Warning during 'move' call: incorrect indices provided.\", \"warn\");\n return;\n }\n if (!this.validateIndex(e) || !this.validateIndex(t)) {\n S(\"Warning during 'move' call: indices cannot be lower than 0 or greater than the amount of blocks.\", \"warn\");\n return;\n }\n this._blocks.move(e, t), this.currentBlockIndex = e, this.blockDidMutated(ia, this.currentBlock, {\n fromIndex: t,\n toIndex: e\n });\n }\n /**\n * Converts passed Block to the new Tool\n * Uses Conversion Config\n *\n * @param blockToConvert - Block that should be converted\n * @param targetToolName - name of the Tool to convert to\n * @param blockDataOverrides - optional new Block data overrides\n */\n async convert(e, t, o) {\n if (!await e.save())\n throw new Error(\"Could not convert Block. Failed to extract original Block data.\");\n const s = this.Editor.Tools.blockTools.get(t);\n if (!s)\n throw new Error(`Could not convert Block. Tool \u00AB${t}\u00BB not found.`);\n const r = await e.exportDataAsString(), a = Z(\n r,\n s.sanitizeConfig\n );\n let l = Bo(a, s.conversionConfig, s.settings);\n return o && (l = Object.assign(l, o)), this.replace(e, s.name, l);\n }\n /**\n * Sets current Block Index -1 which means unknown\n * and clear highlights\n */\n unsetCurrentBlock() {\n this.currentBlockIndex = -1;\n }\n /**\n * Clears Editor\n *\n * @param {boolean} needToAddDefaultBlock - 1) in internal calls (for example, in api.blocks.render)\n * we don't need to add an empty default block\n * 2) in api.blocks.clear we should add empty block\n */\n async clear(e = !1) {\n const t = new sa();\n this.blocks.forEach((o) => {\n t.add(async () => {\n await this.removeBlock(o, !1);\n });\n }), await t.completed, this.unsetCurrentBlock(), e && this.insert(), this.Editor.UI.checkEmptiness();\n }\n /**\n * Cleans up all the block tools' resources\n * This is called when editor is destroyed\n */\n async destroy() {\n await Promise.all(this.blocks.map((e) => e.destroy()));\n }\n /**\n * Bind Block events\n *\n * @param {Block} block - Block to which event should be bound\n */\n bindBlockEvents(e) {\n const { BlockEvents: t } = this.Editor;\n this.readOnlyMutableListeners.on(e.holder, \"keydown\", (o) => {\n t.keydown(o);\n }), this.readOnlyMutableListeners.on(e.holder, \"keyup\", (o) => {\n t.keyup(o);\n }), this.readOnlyMutableListeners.on(e.holder, \"dragover\", (o) => {\n t.dragOver(o);\n }), this.readOnlyMutableListeners.on(e.holder, \"dragleave\", (o) => {\n t.dragLeave(o);\n }), e.on(\"didMutated\", (o) => this.blockDidMutated(Ao, o, {\n index: this.getBlockIndex(o)\n }));\n }\n /**\n * Disable mutable handlers and bindings\n */\n disableModuleBindings() {\n this.readOnlyMutableListeners.clearAll();\n }\n /**\n * Enables all module handlers and bindings for all Blocks\n */\n enableModuleBindings() {\n this.readOnlyMutableListeners.on(\n document,\n \"cut\",\n (e) => this.Editor.BlockEvents.handleCommandX(e)\n ), this.blocks.forEach((e) => {\n this.bindBlockEvents(e);\n });\n }\n /**\n * Validates that the given index is not lower than 0 or higher than the amount of blocks\n *\n * @param {number} index - index of blocks array to validate\n * @returns {boolean}\n */\n validateIndex(e) {\n return !(e < 0 || e >= this._blocks.length);\n }\n /**\n * Block mutation callback\n *\n * @param mutationType - what happened with block\n * @param block - mutated block\n * @param detailData - additional data to pass with change event\n */\n blockDidMutated(e, t, o) {\n const i = new CustomEvent(e, {\n detail: {\n target: new J(t),\n ...o\n }\n });\n return this.eventsDispatcher.emit($o, {\n event: i\n }), t;\n }\n}\nclass aa extends E {\n constructor() {\n super(...arguments), this.anyBlockSelectedCache = null, this.needToSelectAll = !1, this.nativeInputSelected = !1, this.readyToBlockSelection = !1;\n }\n /**\n * Sanitizer Config\n *\n * @returns {SanitizerConfig}\n */\n get sanitizerConfig() {\n return {\n p: {},\n h1: {},\n h2: {},\n h3: {},\n h4: {},\n h5: {},\n h6: {},\n ol: {},\n ul: {},\n li: {},\n br: !0,\n img: {\n src: !0,\n width: !0,\n height: !0\n },\n a: {\n href: !0\n },\n b: {},\n i: {},\n u: {}\n };\n }\n /**\n * Flag that identifies all Blocks selection\n *\n * @returns {boolean}\n */\n get allBlocksSelected() {\n const { BlockManager: e } = this.Editor;\n return e.blocks.every((t) => t.selected === !0);\n }\n /**\n * Set selected all blocks\n *\n * @param {boolean} state - state to set\n */\n set allBlocksSelected(e) {\n const { BlockManager: t } = this.Editor;\n t.blocks.forEach((o) => {\n o.selected = e;\n }), this.clearCache();\n }\n /**\n * Flag that identifies any Block selection\n *\n * @returns {boolean}\n */\n get anyBlockSelected() {\n const { BlockManager: e } = this.Editor;\n return this.anyBlockSelectedCache === null && (this.anyBlockSelectedCache = e.blocks.some((t) => t.selected === !0)), this.anyBlockSelectedCache;\n }\n /**\n * Return selected Blocks array\n *\n * @returns {Block[]}\n */\n get selectedBlocks() {\n return this.Editor.BlockManager.blocks.filter((e) => e.selected);\n }\n /**\n * Module Preparation\n * Registers Shortcuts CMD+A and CMD+C\n * to select all and copy them\n */\n prepare() {\n this.selection = new b(), ge.add({\n name: \"CMD+A\",\n handler: (e) => {\n const { BlockManager: t, ReadOnly: o } = this.Editor;\n if (o.isEnabled) {\n e.preventDefault(), this.selectAllBlocks();\n return;\n }\n t.currentBlock && this.handleCommandA(e);\n },\n on: this.Editor.UI.nodes.redactor\n });\n }\n /**\n * Toggle read-only state\n *\n * - Remove all ranges\n * - Unselect all Blocks\n */\n toggleReadOnly() {\n b.get().removeAllRanges(), this.allBlocksSelected = !1;\n }\n /**\n * Remove selection of Block\n *\n * @param {number?} index - Block index according to the BlockManager's indexes\n */\n unSelectBlockByIndex(e) {\n const { BlockManager: t } = this.Editor;\n let o;\n isNaN(e) ? o = t.currentBlock : o = t.getBlockByIndex(e), o.selected = !1, this.clearCache();\n }\n /**\n * Clear selection from Blocks\n *\n * @param {Event} reason - event caused clear of selection\n * @param {boolean} restoreSelection - if true, restore saved selection\n */\n clearSelection(e, t = !1) {\n const { BlockManager: o, Caret: i, RectangleSelection: s } = this.Editor;\n this.needToSelectAll = !1, this.nativeInputSelected = !1, this.readyToBlockSelection = !1;\n const r = e && e instanceof KeyboardEvent, a = r && Po(e.keyCode);\n if (this.anyBlockSelected && r && a && !b.isSelectionExists) {\n const l = o.removeSelectedBlocks();\n o.insertDefaultBlockAtIndex(l, !0), i.setToBlock(o.currentBlock), Fe(() => {\n const c = e.key;\n i.insertContentAtCaretPosition(c.length > 1 ? \"\" : c);\n }, 20)();\n }\n if (this.Editor.CrossBlockSelection.clear(e), !this.anyBlockSelected || s.isRectActivated()) {\n this.Editor.RectangleSelection.clearSelection();\n return;\n }\n t && this.selection.restore(), this.allBlocksSelected = !1;\n }\n /**\n * Reduce each Block and copy its content\n *\n * @param {ClipboardEvent} e - copy/cut event\n * @returns {Promise<void>}\n */\n copySelectedBlocks(e) {\n e.preventDefault();\n const t = d.make(\"div\");\n this.selectedBlocks.forEach((s) => {\n const r = Z(s.holder.innerHTML, this.sanitizerConfig), a = d.make(\"p\");\n a.innerHTML = r, t.appendChild(a);\n });\n const o = Array.from(t.childNodes).map((s) => s.textContent).join(`\n\n`), i = t.innerHTML;\n return e.clipboardData.setData(\"text/plain\", o), e.clipboardData.setData(\"text/html\", i), Promise.all(this.selectedBlocks.map((s) => s.save())).then((s) => {\n try {\n e.clipboardData.setData(this.Editor.Paste.MIME_TYPE, JSON.stringify(s));\n } catch {\n }\n });\n }\n /**\n * Select Block by its index\n *\n * @param {number?} index - Block index according to the BlockManager's indexes\n */\n selectBlockByIndex(e) {\n const { BlockManager: t } = this.Editor, o = t.getBlockByIndex(e);\n o !== void 0 && this.selectBlock(o);\n }\n /**\n * Select passed Block\n *\n * @param {Block} block - Block to select\n */\n selectBlock(e) {\n this.selection.save(), b.get().removeAllRanges(), e.selected = !0, this.clearCache(), this.Editor.InlineToolbar.close();\n }\n /**\n * Remove selection from passed Block\n *\n * @param {Block} block - Block to unselect\n */\n unselectBlock(e) {\n e.selected = !1, this.clearCache();\n }\n /**\n * Clear anyBlockSelected cache\n */\n clearCache() {\n this.anyBlockSelectedCache = null;\n }\n /**\n * Module destruction\n * De-registers Shortcut CMD+A\n */\n destroy() {\n ge.remove(this.Editor.UI.nodes.redactor, \"CMD+A\");\n }\n /**\n * First CMD+A selects all input content by native behaviour,\n * next CMD+A keypress selects all blocks\n *\n * @param {KeyboardEvent} event - keyboard event\n */\n handleCommandA(e) {\n if (this.Editor.RectangleSelection.clearSelection(), d.isNativeInput(e.target) && !this.readyToBlockSelection) {\n this.readyToBlockSelection = !0;\n return;\n }\n const t = this.Editor.BlockManager.getBlock(e.target), o = t.inputs;\n if (o.length > 1 && !this.readyToBlockSelection) {\n this.readyToBlockSelection = !0;\n return;\n }\n if (o.length === 1 && !this.needToSelectAll) {\n this.needToSelectAll = !0;\n return;\n }\n this.needToSelectAll ? (e.preventDefault(), this.selectAllBlocks(), this.needToSelectAll = !1, this.readyToBlockSelection = !1) : this.readyToBlockSelection && (e.preventDefault(), this.selectBlock(t), this.needToSelectAll = !0);\n }\n /**\n * Select All Blocks\n * Each Block has selected setter that makes Block copyable\n */\n selectAllBlocks() {\n this.selection.save(), b.get().removeAllRanges(), this.allBlocksSelected = !0, this.Editor.InlineToolbar.close();\n }\n}\nclass Ye extends E {\n /**\n * Allowed caret positions in input\n *\n * @static\n * @returns {{START: string, END: string, DEFAULT: string}}\n */\n get positions() {\n return {\n START: \"start\",\n END: \"end\",\n DEFAULT: \"default\"\n };\n }\n /**\n * Elements styles that can be useful for Caret Module\n */\n static get CSS() {\n return {\n shadowCaret: \"cdx-shadow-caret\"\n };\n }\n /**\n * Method gets Block instance and puts caret to the text node with offset\n * There two ways that method applies caret position:\n * - first found text node: sets at the beginning, but you can pass an offset\n * - last found text node: sets at the end of the node. Also, you can customize the behaviour\n *\n * @param {Block} block - Block class\n * @param {string} position - position where to set caret.\n * If default - leave default behaviour and apply offset if it's passed\n * @param {number} offset - caret offset regarding to the text node\n */\n setToBlock(e, t = this.positions.DEFAULT, o = 0) {\n var c;\n const { BlockManager: i, BlockSelection: s } = this.Editor;\n if (s.clearSelection(), !e.focusable) {\n (c = window.getSelection()) == null || c.removeAllRanges(), s.selectBlock(e), i.currentBlock = e;\n return;\n }\n let r;\n switch (t) {\n case this.positions.START:\n r = e.firstInput;\n break;\n case this.positions.END:\n r = e.lastInput;\n break;\n default:\n r = e.currentInput;\n }\n if (!r)\n return;\n const a = d.getDeepestNode(r, t === this.positions.END), l = d.getContentLength(a);\n switch (!0) {\n case t === this.positions.START:\n o = 0;\n break;\n case t === this.positions.END:\n case o > l:\n o = l;\n break;\n }\n this.set(a, o), i.setCurrentBlockByChildNode(e.holder), i.currentBlock.currentInput = r;\n }\n /**\n * Set caret to the current input of current Block.\n *\n * @param {HTMLElement} input - input where caret should be set\n * @param {string} position - position of the caret.\n * If default - leave default behaviour and apply offset if it's passed\n * @param {number} offset - caret offset regarding to the text node\n */\n setToInput(e, t = this.positions.DEFAULT, o = 0) {\n const { currentBlock: i } = this.Editor.BlockManager, s = d.getDeepestNode(e);\n switch (t) {\n case this.positions.START:\n this.set(s, 0);\n break;\n case this.positions.END:\n this.set(s, d.getContentLength(s));\n break;\n default:\n o && this.set(s, o);\n }\n i.currentInput = e;\n }\n /**\n * Creates Document Range and sets caret to the element with offset\n *\n * @param {HTMLElement} element - target node.\n * @param {number} offset - offset\n */\n set(e, t = 0) {\n const { top: i, bottom: s } = b.setCursor(e, t), { innerHeight: r } = window;\n i < 0 ? window.scrollBy(0, i - 30) : s > r && window.scrollBy(0, s - r + 30);\n }\n /**\n * Set Caret to the last Block\n * If last block is not empty, append another empty block\n */\n setToTheLastBlock() {\n const e = this.Editor.BlockManager.lastBlock;\n if (e)\n if (e.tool.isDefault && e.isEmpty)\n this.setToBlock(e);\n else {\n const t = this.Editor.BlockManager.insertAtEnd();\n this.setToBlock(t);\n }\n }\n /**\n * Extract content fragment of current Block from Caret position to the end of the Block\n */\n extractFragmentFromCaretPosition() {\n const e = b.get();\n if (e.rangeCount) {\n const t = e.getRangeAt(0), o = this.Editor.BlockManager.currentBlock.currentInput;\n if (t.deleteContents(), o)\n if (d.isNativeInput(o)) {\n const i = o, s = document.createDocumentFragment(), r = i.value.substring(0, i.selectionStart), a = i.value.substring(i.selectionStart);\n return s.textContent = a, i.value = r, s;\n } else {\n const i = t.cloneRange();\n return i.selectNodeContents(o), i.setStart(t.endContainer, t.endOffset), i.extractContents();\n }\n }\n }\n /**\n * Set's caret to the next Block or Tool`s input\n * Before moving caret, we should check if caret position is at the end of Plugins node\n * Using {@link Dom#getDeepestNode} to get a last node and match with current selection\n *\n * @param {boolean} force - pass true to skip check for caret position\n */\n navigateNext(e = !1) {\n const { BlockManager: t } = this.Editor, { currentBlock: o, nextBlock: i } = t;\n if (o === void 0)\n return !1;\n const { nextInput: s, currentInput: r } = o, a = r !== void 0 ? Re(r) : void 0;\n let l = i;\n const c = e || a || !o.focusable;\n if (s && c)\n return this.setToInput(s, this.positions.START), !0;\n if (l === null) {\n if (o.tool.isDefault || !c)\n return !1;\n l = t.insertAtEnd();\n }\n return c ? (this.setToBlock(l, this.positions.START), !0) : !1;\n }\n /**\n * Set's caret to the previous Tool`s input or Block\n * Before moving caret, we should check if caret position is start of the Plugins node\n * Using {@link Dom#getDeepestNode} to get a last node and match with current selection\n *\n * @param {boolean} force - pass true to skip check for caret position\n */\n navigatePrevious(e = !1) {\n const { currentBlock: t, previousBlock: o } = this.Editor.BlockManager;\n if (!t)\n return !1;\n const { previousInput: i, currentInput: s } = t, r = s !== void 0 ? Ne(s) : void 0, a = e || r || !t.focusable;\n return i && a ? (this.setToInput(i, this.positions.END), !0) : o !== null && a ? (this.setToBlock(o, this.positions.END), !0) : !1;\n }\n /**\n * Inserts shadow element after passed element where caret can be placed\n *\n * @param {Element} element - element after which shadow caret should be inserted\n */\n createShadow(e) {\n const t = document.createElement(\"span\");\n t.classList.add(Ye.CSS.shadowCaret), e.insertAdjacentElement(\"beforeend\", t);\n }\n /**\n * Restores caret position\n *\n * @param {HTMLElement} element - element where caret should be restored\n */\n restoreCaret(e) {\n const t = e.querySelector(`.${Ye.CSS.shadowCaret}`);\n if (!t)\n return;\n new b().expandToTag(t);\n const i = document.createRange();\n i.selectNode(t), i.extractContents();\n }\n /**\n * Inserts passed content at caret position\n *\n * @param {string} content - content to insert\n */\n insertContentAtCaretPosition(e) {\n const t = document.createDocumentFragment(), o = document.createElement(\"div\"), i = b.get(), s = b.range;\n o.innerHTML = e, Array.from(o.childNodes).forEach((c) => t.appendChild(c)), t.childNodes.length === 0 && t.appendChild(new Text());\n const r = t.lastChild;\n s.deleteContents(), s.insertNode(t);\n const a = document.createRange(), l = r.nodeType === Node.TEXT_NODE ? r : r.firstChild;\n l !== null && l.textContent !== null && a.setStart(l, l.textContent.length), i.removeAllRanges(), i.addRange(a);\n }\n}\nclass la extends E {\n constructor() {\n super(...arguments), this.onMouseUp = () => {\n this.listeners.off(document, \"mouseover\", this.onMouseOver), this.listeners.off(document, \"mouseup\", this.onMouseUp);\n }, this.onMouseOver = (e) => {\n const { BlockManager: t, BlockSelection: o } = this.Editor;\n if (e.relatedTarget === null && e.target === null)\n return;\n const i = t.getBlockByChildNode(e.relatedTarget) || this.lastSelectedBlock, s = t.getBlockByChildNode(e.target);\n if (!(!i || !s) && s !== i) {\n if (i === this.firstSelectedBlock) {\n b.get().removeAllRanges(), i.selected = !0, s.selected = !0, o.clearCache();\n return;\n }\n if (s === this.firstSelectedBlock) {\n i.selected = !1, s.selected = !1, o.clearCache();\n return;\n }\n this.Editor.InlineToolbar.close(), this.toggleBlocksSelectedState(i, s), this.lastSelectedBlock = s;\n }\n };\n }\n /**\n * Module preparation\n *\n * @returns {Promise}\n */\n async prepare() {\n this.listeners.on(document, \"mousedown\", (e) => {\n this.enableCrossBlockSelection(e);\n });\n }\n /**\n * Sets up listeners\n *\n * @param {MouseEvent} event - mouse down event\n */\n watchSelection(e) {\n if (e.button !== qn.LEFT)\n return;\n const { BlockManager: t } = this.Editor;\n this.firstSelectedBlock = t.getBlock(e.target), this.lastSelectedBlock = this.firstSelectedBlock, this.listeners.on(document, \"mouseover\", this.onMouseOver), this.listeners.on(document, \"mouseup\", this.onMouseUp);\n }\n /**\n * Return boolean is cross block selection started:\n * there should be at least 2 selected blocks\n */\n get isCrossBlockSelectionStarted() {\n return !!this.firstSelectedBlock && !!this.lastSelectedBlock && this.firstSelectedBlock !== this.lastSelectedBlock;\n }\n /**\n * Change selection state of the next Block\n * Used for CBS via Shift + arrow keys\n *\n * @param {boolean} next - if true, toggle next block. Previous otherwise\n */\n toggleBlockSelectedState(e = !0) {\n const { BlockManager: t, BlockSelection: o } = this.Editor;\n this.lastSelectedBlock || (this.lastSelectedBlock = this.firstSelectedBlock = t.currentBlock), this.firstSelectedBlock === this.lastSelectedBlock && (this.firstSelectedBlock.selected = !0, o.clearCache(), b.get().removeAllRanges());\n const i = t.blocks.indexOf(this.lastSelectedBlock) + (e ? 1 : -1), s = t.blocks[i];\n s && (this.lastSelectedBlock.selected !== s.selected ? (s.selected = !0, o.clearCache()) : (this.lastSelectedBlock.selected = !1, o.clearCache()), this.lastSelectedBlock = s, this.Editor.InlineToolbar.close(), s.holder.scrollIntoView({\n block: \"nearest\"\n }));\n }\n /**\n * Clear saved state\n *\n * @param {Event} reason - event caused clear of selection\n */\n clear(e) {\n const { BlockManager: t, BlockSelection: o, Caret: i } = this.Editor, s = t.blocks.indexOf(this.firstSelectedBlock), r = t.blocks.indexOf(this.lastSelectedBlock);\n if (o.anyBlockSelected && s > -1 && r > -1 && e && e instanceof KeyboardEvent)\n switch (e.keyCode) {\n case y.DOWN:\n case y.RIGHT:\n i.setToBlock(t.blocks[Math.max(s, r)], i.positions.END);\n break;\n case y.UP:\n case y.LEFT:\n i.setToBlock(t.blocks[Math.min(s, r)], i.positions.START);\n break;\n default:\n i.setToBlock(t.blocks[Math.max(s, r)], i.positions.END);\n }\n this.firstSelectedBlock = this.lastSelectedBlock = null;\n }\n /**\n * Enables Cross Block Selection\n *\n * @param {MouseEvent} event - mouse down event\n */\n enableCrossBlockSelection(e) {\n const { UI: t } = this.Editor;\n b.isCollapsed || this.Editor.BlockSelection.clearSelection(e), t.nodes.redactor.contains(e.target) ? this.watchSelection(e) : this.Editor.BlockSelection.clearSelection(e);\n }\n /**\n * Change blocks selection state between passed two blocks.\n *\n * @param {Block} firstBlock - first block in range\n * @param {Block} lastBlock - last block in range\n */\n toggleBlocksSelectedState(e, t) {\n const { BlockManager: o, BlockSelection: i } = this.Editor, s = o.blocks.indexOf(e), r = o.blocks.indexOf(t), a = e.selected !== t.selected;\n for (let l = Math.min(s, r); l <= Math.max(s, r); l++) {\n const c = o.blocks[l];\n c !== this.firstSelectedBlock && c !== (a ? e : t) && (o.blocks[l].selected = !o.blocks[l].selected, i.clearCache());\n }\n }\n}\nclass ca extends E {\n constructor() {\n super(...arguments), this.isStartedAtEditor = !1;\n }\n /**\n * Toggle read-only state\n *\n * if state is true:\n * - disable all drag-n-drop event handlers\n *\n * if state is false:\n * - restore drag-n-drop event handlers\n *\n * @param {boolean} readOnlyEnabled - \"read only\" state\n */\n toggleReadOnly(e) {\n e ? this.disableModuleBindings() : this.enableModuleBindings();\n }\n /**\n * Add drag events listeners to editor zone\n */\n enableModuleBindings() {\n const { UI: e } = this.Editor;\n this.readOnlyMutableListeners.on(e.nodes.holder, \"drop\", async (t) => {\n await this.processDrop(t);\n }, !0), this.readOnlyMutableListeners.on(e.nodes.holder, \"dragstart\", () => {\n this.processDragStart();\n }), this.readOnlyMutableListeners.on(e.nodes.holder, \"dragover\", (t) => {\n this.processDragOver(t);\n }, !0);\n }\n /**\n * Unbind drag-n-drop event handlers\n */\n disableModuleBindings() {\n this.readOnlyMutableListeners.clearAll();\n }\n /**\n * Handle drop event\n *\n * @param {DragEvent} dropEvent - drop event\n */\n async processDrop(e) {\n const {\n BlockManager: t,\n Paste: o,\n Caret: i\n } = this.Editor;\n e.preventDefault(), t.blocks.forEach((r) => {\n r.dropTarget = !1;\n }), b.isAtEditor && !b.isCollapsed && this.isStartedAtEditor && document.execCommand(\"delete\"), this.isStartedAtEditor = !1;\n const s = t.setCurrentBlockByChildNode(e.target);\n if (s)\n this.Editor.Caret.setToBlock(s, i.positions.END);\n else {\n const r = t.setCurrentBlockByChildNode(t.lastBlock.holder);\n this.Editor.Caret.setToBlock(r, i.positions.END);\n }\n await o.processDataTransfer(e.dataTransfer, !0);\n }\n /**\n * Handle drag start event\n */\n processDragStart() {\n b.isAtEditor && !b.isCollapsed && (this.isStartedAtEditor = !0), this.Editor.InlineToolbar.close();\n }\n /**\n * @param {DragEvent} dragEvent - drag event\n */\n processDragOver(e) {\n e.preventDefault();\n }\n}\nconst da = 180, ua = 400;\nclass ha extends E {\n /**\n * Prepare the module\n *\n * @param options - options used by the modification observer module\n * @param options.config - Editor configuration object\n * @param options.eventsDispatcher - common Editor event bus\n */\n constructor({ config: e, eventsDispatcher: t }) {\n super({\n config: e,\n eventsDispatcher: t\n }), this.disabled = !1, this.batchingTimeout = null, this.batchingOnChangeQueue = /* @__PURE__ */ new Map(), this.batchTime = ua, this.mutationObserver = new MutationObserver((o) => {\n this.redactorChanged(o);\n }), this.eventsDispatcher.on($o, (o) => {\n this.particularBlockChanged(o.event);\n }), this.eventsDispatcher.on(zo, () => {\n this.disable();\n }), this.eventsDispatcher.on(Uo, () => {\n this.enable();\n });\n }\n /**\n * Enables onChange event\n */\n enable() {\n this.mutationObserver.observe(\n this.Editor.UI.nodes.redactor,\n {\n childList: !0,\n subtree: !0,\n characterData: !0,\n attributes: !0\n }\n ), this.disabled = !1;\n }\n /**\n * Disables onChange event\n */\n disable() {\n this.mutationObserver.disconnect(), this.disabled = !0;\n }\n /**\n * Call onChange event passed to Editor.js configuration\n *\n * @param event - some of our custom change events\n */\n particularBlockChanged(e) {\n this.disabled || !A(this.config.onChange) || (this.batchingOnChangeQueue.set(`block:${e.detail.target.id}:event:${e.type}`, e), this.batchingTimeout && clearTimeout(this.batchingTimeout), this.batchingTimeout = setTimeout(() => {\n let t;\n this.batchingOnChangeQueue.size === 1 ? t = this.batchingOnChangeQueue.values().next().value : t = Array.from(this.batchingOnChangeQueue.values()), this.config.onChange && this.config.onChange(this.Editor.API.methods, t), this.batchingOnChangeQueue.clear();\n }, this.batchTime));\n }\n /**\n * Fired on every blocks wrapper dom change\n *\n * @param mutations - mutations happened\n */\n redactorChanged(e) {\n this.eventsDispatcher.emit(ft, {\n mutations: e\n });\n }\n}\nconst Rn = class Dn extends E {\n constructor() {\n super(...arguments), this.MIME_TYPE = \"application/x-editor-js\", this.toolsTags = {}, this.tagsByTool = {}, this.toolsPatterns = [], this.toolsFiles = {}, this.exceptionList = [], this.processTool = (e) => {\n try {\n const t = e.create({}, {}, !1);\n if (e.pasteConfig === !1) {\n this.exceptionList.push(e.name);\n return;\n }\n if (!A(t.onPaste))\n return;\n this.getTagsConfig(e), this.getFilesConfig(e), this.getPatternsConfig(e);\n } catch (t) {\n S(\n `Paste handling for \u00AB${e.name}\u00BB Tool hasn't been set up because of the error`,\n \"warn\",\n t\n );\n }\n }, this.handlePasteEvent = async (e) => {\n const { BlockManager: t, Toolbar: o } = this.Editor, i = t.setCurrentBlockByChildNode(e.target);\n !i || this.isNativeBehaviour(e.target) && !e.clipboardData.types.includes(\"Files\") || i && this.exceptionList.includes(i.name) || (e.preventDefault(), this.processDataTransfer(e.clipboardData), o.close());\n };\n }\n /**\n * Set onPaste callback and collect tools` paste configurations\n */\n async prepare() {\n this.processTools();\n }\n /**\n * Set read-only state\n *\n * @param {boolean} readOnlyEnabled - read only flag value\n */\n toggleReadOnly(e) {\n e ? this.unsetCallback() : this.setCallback();\n }\n /**\n * Handle pasted or dropped data transfer object\n *\n * @param {DataTransfer} dataTransfer - pasted or dropped data transfer object\n * @param {boolean} isDragNDrop - true if data transfer comes from drag'n'drop events\n */\n async processDataTransfer(e, t = !1) {\n const { Tools: o } = this.Editor, i = e.types;\n if ((i.includes ? i.includes(\"Files\") : i.contains(\"Files\")) && !V(this.toolsFiles)) {\n await this.processFiles(e.files);\n return;\n }\n const r = e.getData(this.MIME_TYPE), a = e.getData(\"text/plain\");\n let l = e.getData(\"text/html\");\n if (r)\n try {\n this.insertEditorJSData(JSON.parse(r));\n return;\n } catch {\n }\n t && a.trim() && l.trim() && (l = \"<p>\" + (l.trim() ? l : a) + \"</p>\");\n const c = Object.keys(this.toolsTags).reduce((p, g) => (p[g.toLowerCase()] = this.toolsTags[g].sanitizationConfig ?? {}, p), {}), u = Object.assign({}, c, o.getAllInlineToolsSanitizeConfig(), { br: {} }), h = Z(l, u);\n !h.trim() || h.trim() === a || !d.isHTMLString(h) ? await this.processText(a) : await this.processText(h, !0);\n }\n /**\n * Process pasted text and divide them into Blocks\n *\n * @param {string} data - text to process. Can be HTML or plain.\n * @param {boolean} isHTML - if passed string is HTML, this parameter should be true\n */\n async processText(e, t = !1) {\n const { Caret: o, BlockManager: i } = this.Editor, s = t ? this.processHTML(e) : this.processPlain(e);\n if (!s.length)\n return;\n if (s.length === 1) {\n s[0].isBlock ? this.processSingleBlock(s.pop()) : this.processInlinePaste(s.pop());\n return;\n }\n const a = i.currentBlock && i.currentBlock.tool.isDefault && i.currentBlock.isEmpty;\n s.map(\n async (l, c) => this.insertBlock(l, c === 0 && a)\n ), i.currentBlock && o.setToBlock(i.currentBlock, o.positions.END);\n }\n /**\n * Set onPaste callback handler\n */\n setCallback() {\n this.listeners.on(this.Editor.UI.nodes.holder, \"paste\", this.handlePasteEvent);\n }\n /**\n * Unset onPaste callback handler\n */\n unsetCallback() {\n this.listeners.off(this.Editor.UI.nodes.holder, \"paste\", this.handlePasteEvent);\n }\n /**\n * Get and process tool`s paste configs\n */\n processTools() {\n const e = this.Editor.Tools.blockTools;\n Array.from(e.values()).forEach(this.processTool);\n }\n /**\n * Get tags name list from either tag name or sanitization config.\n *\n * @param {string | object} tagOrSanitizeConfig - tag name or sanitize config object.\n * @returns {string[]} array of tags.\n */\n collectTagNames(e) {\n return te(e) ? [e] : D(e) ? Object.keys(e) : [];\n }\n /**\n * Get tags to substitute by Tool\n *\n * @param tool - BlockTool object\n */\n getTagsConfig(e) {\n if (e.pasteConfig === !1)\n return;\n const t = e.pasteConfig.tags || [], o = [];\n t.forEach((i) => {\n const s = this.collectTagNames(i);\n o.push(...s), s.forEach((r) => {\n if (Object.prototype.hasOwnProperty.call(this.toolsTags, r)) {\n S(\n `Paste handler for \u00AB${e.name}\u00BB Tool on \u00AB${r}\u00BB tag is skipped because it is already used by \u00AB${this.toolsTags[r].tool.name}\u00BB Tool.`,\n \"warn\"\n );\n return;\n }\n const a = D(i) ? i[r] : null;\n this.toolsTags[r.toUpperCase()] = {\n tool: e,\n sanitizationConfig: a\n };\n });\n }), this.tagsByTool[e.name] = o.map((i) => i.toUpperCase());\n }\n /**\n * Get files` types and extensions to substitute by Tool\n *\n * @param tool - BlockTool object\n */\n getFilesConfig(e) {\n if (e.pasteConfig === !1)\n return;\n const { files: t = {} } = e.pasteConfig;\n let { extensions: o, mimeTypes: i } = t;\n !o && !i || (o && !Array.isArray(o) && (S(`\u00ABextensions\u00BB property of the onDrop config for \u00AB${e.name}\u00BB Tool should be an array`), o = []), i && !Array.isArray(i) && (S(`\u00ABmimeTypes\u00BB property of the onDrop config for \u00AB${e.name}\u00BB Tool should be an array`), i = []), i && (i = i.filter((s) => ei(s) ? !0 : (S(`MIME type value \u00AB${s}\u00BB for the \u00AB${e.name}\u00BB Tool is not a valid MIME type`, \"warn\"), !1))), this.toolsFiles[e.name] = {\n extensions: o || [],\n mimeTypes: i || []\n });\n }\n /**\n * Get RegExp patterns to substitute by Tool\n *\n * @param tool - BlockTool object\n */\n getPatternsConfig(e) {\n e.pasteConfig === !1 || !e.pasteConfig.patterns || V(e.pasteConfig.patterns) || Object.entries(e.pasteConfig.patterns).forEach(([t, o]) => {\n o instanceof RegExp || S(\n `Pattern ${o} for \u00AB${e.name}\u00BB Tool is skipped because it should be a Regexp instance.`,\n \"warn\"\n ), this.toolsPatterns.push({\n key: t,\n pattern: o,\n tool: e\n });\n });\n }\n /**\n * Check if browser behavior suits better\n *\n * @param {EventTarget} element - element where content has been pasted\n * @returns {boolean}\n */\n isNativeBehaviour(e) {\n return d.isNativeInput(e);\n }\n /**\n * Get files from data transfer object and insert related Tools\n *\n * @param {FileList} items - pasted or dropped items\n */\n async processFiles(e) {\n const { BlockManager: t } = this.Editor;\n let o;\n o = await Promise.all(\n Array.from(e).map((r) => this.processFile(r))\n ), o = o.filter((r) => !!r);\n const s = t.currentBlock.tool.isDefault && t.currentBlock.isEmpty;\n o.forEach(\n (r, a) => {\n t.paste(r.type, r.event, a === 0 && s);\n }\n );\n }\n /**\n * Get information about file and find Tool to handle it\n *\n * @param {File} file - file to process\n */\n async processFile(e) {\n const t = Jn(e), o = Object.entries(this.toolsFiles).find(([r, { mimeTypes: a, extensions: l }]) => {\n const [c, u] = e.type.split(\"/\"), h = l.find((g) => g.toLowerCase() === t.toLowerCase()), p = a.find((g) => {\n const [f, v] = g.split(\"/\");\n return f === c && (v === u || v === \"*\");\n });\n return !!h || !!p;\n });\n if (!o)\n return;\n const [i] = o;\n return {\n event: this.composePasteEvent(\"file\", {\n file: e\n }),\n type: i\n };\n }\n /**\n * Split HTML string to blocks and return it as array of Block data\n *\n * @param {string} innerHTML - html string to process\n * @returns {PasteData[]}\n */\n processHTML(e) {\n const { Tools: t } = this.Editor, o = d.make(\"DIV\");\n return o.innerHTML = e, this.getNodes(o).map((s) => {\n let r, a = t.defaultTool, l = !1;\n switch (s.nodeType) {\n case Node.DOCUMENT_FRAGMENT_NODE:\n r = d.make(\"div\"), r.appendChild(s);\n break;\n case Node.ELEMENT_NODE:\n r = s, l = !0, this.toolsTags[r.tagName] && (a = this.toolsTags[r.tagName].tool);\n break;\n }\n const { tags: c } = a.pasteConfig || { tags: [] }, u = c.reduce((g, f) => (this.collectTagNames(f).forEach((O) => {\n const T = D(f) ? f[O] : null;\n g[O.toLowerCase()] = T || {};\n }), g), {}), h = Object.assign({}, u, a.baseSanitizeConfig);\n if (r.tagName.toLowerCase() === \"table\") {\n const g = Z(r.outerHTML, h);\n r = d.make(\"div\", void 0, {\n innerHTML: g\n }).firstChild;\n } else\n r.innerHTML = Z(r.innerHTML, h);\n const p = this.composePasteEvent(\"tag\", {\n data: r\n });\n return {\n content: r,\n isBlock: l,\n tool: a.name,\n event: p\n };\n }).filter((s) => {\n const r = d.isEmpty(s.content), a = d.isSingleTag(s.content);\n return !r || a;\n });\n }\n /**\n * Split plain text by new line symbols and return it as array of Block data\n *\n * @param {string} plain - string to process\n * @returns {PasteData[]}\n */\n processPlain(e) {\n const { defaultBlock: t } = this.config;\n if (!e)\n return [];\n const o = t;\n return e.split(/\\r?\\n/).filter((i) => i.trim()).map((i) => {\n const s = d.make(\"div\");\n s.textContent = i;\n const r = this.composePasteEvent(\"tag\", {\n data: s\n });\n return {\n content: s,\n tool: o,\n isBlock: !1,\n event: r\n };\n });\n }\n /**\n * Process paste of single Block tool content\n *\n * @param {PasteData} dataToInsert - data of Block to insert\n */\n async processSingleBlock(e) {\n const { Caret: t, BlockManager: o } = this.Editor, { currentBlock: i } = o;\n if (!i || e.tool !== i.name || !d.containsOnlyInlineElements(e.content.innerHTML)) {\n this.insertBlock(e, (i == null ? void 0 : i.tool.isDefault) && i.isEmpty);\n return;\n }\n t.insertContentAtCaretPosition(e.content.innerHTML);\n }\n /**\n * Process paste to single Block:\n * 1. Find patterns` matches\n * 2. Insert new block if it is not the same type as current one\n * 3. Just insert text if there is no substitutions\n *\n * @param {PasteData} dataToInsert - data of Block to insert\n */\n async processInlinePaste(e) {\n const { BlockManager: t, Caret: o } = this.Editor, { content: i } = e;\n if (t.currentBlock && t.currentBlock.tool.isDefault && i.textContent.length < Dn.PATTERN_PROCESSING_MAX_LENGTH) {\n const r = await this.processPattern(i.textContent);\n if (r) {\n const a = t.currentBlock && t.currentBlock.tool.isDefault && t.currentBlock.isEmpty, l = t.paste(r.tool, r.event, a);\n o.setToBlock(l, o.positions.END);\n return;\n }\n }\n if (t.currentBlock && t.currentBlock.currentInput) {\n const r = t.currentBlock.tool.baseSanitizeConfig;\n document.execCommand(\n \"insertHTML\",\n !1,\n Z(i.innerHTML, r)\n );\n } else\n this.insertBlock(e);\n }\n /**\n * Get patterns` matches\n *\n * @param {string} text - text to process\n * @returns {Promise<{event: PasteEvent, tool: string}>}\n */\n async processPattern(e) {\n const t = this.toolsPatterns.find((i) => {\n const s = i.pattern.exec(e);\n return s ? e === s.shift() : !1;\n });\n return t ? {\n event: this.composePasteEvent(\"pattern\", {\n key: t.key,\n data: e\n }),\n tool: t.tool.name\n } : void 0;\n }\n /**\n * Insert pasted Block content to Editor\n *\n * @param {PasteData} data - data to insert\n * @param {boolean} canReplaceCurrentBlock - if true and is current Block is empty, will replace current Block\n * @returns {void}\n */\n insertBlock(e, t = !1) {\n const { BlockManager: o, Caret: i } = this.Editor, { currentBlock: s } = o;\n let r;\n if (t && s && s.isEmpty) {\n r = o.paste(e.tool, e.event, !0), i.setToBlock(r, i.positions.END);\n return;\n }\n r = o.paste(e.tool, e.event), i.setToBlock(r, i.positions.END);\n }\n /**\n * Insert data passed as application/x-editor-js JSON\n *\n * @param {Array} blocks \u2014 Blocks' data to insert\n * @returns {void}\n */\n insertEditorJSData(e) {\n const { BlockManager: t, Caret: o, Tools: i } = this.Editor;\n yt(\n e,\n (r) => i.blockTools.get(r).sanitizeConfig\n ).forEach(({ tool: r, data: a }, l) => {\n let c = !1;\n l === 0 && (c = t.currentBlock && t.currentBlock.tool.isDefault && t.currentBlock.isEmpty);\n const u = t.insert({\n tool: r,\n data: a,\n replace: c\n });\n o.setToBlock(u, o.positions.END);\n });\n }\n /**\n * Fetch nodes from Element node\n *\n * @param {Node} node - current node\n * @param {Node[]} nodes - processed nodes\n * @param {Node} destNode - destination node\n */\n processElementNode(e, t, o) {\n const i = Object.keys(this.toolsTags), s = e, { tool: r } = this.toolsTags[s.tagName] || {}, a = this.tagsByTool[r == null ? void 0 : r.name] || [], l = i.includes(s.tagName), c = d.blockElements.includes(s.tagName.toLowerCase()), u = Array.from(s.children).some(\n ({ tagName: p }) => i.includes(p) && !a.includes(p)\n ), h = Array.from(s.children).some(\n ({ tagName: p }) => d.blockElements.includes(p.toLowerCase())\n );\n if (!c && !l && !u)\n return o.appendChild(s), [...t, o];\n if (l && !u || c && !h && !u)\n return [...t, o, s];\n }\n /**\n * Recursively divide HTML string to two types of nodes:\n * 1. Block element\n * 2. Document Fragments contained text and markup tags like a, b, i etc.\n *\n * @param {Node} wrapper - wrapper of paster HTML content\n * @returns {Node[]}\n */\n getNodes(e) {\n const t = Array.from(e.childNodes);\n let o;\n const i = (s, r) => {\n if (d.isEmpty(r) && !d.isSingleTag(r))\n return s;\n const a = s[s.length - 1];\n let l = new DocumentFragment();\n switch (a && d.isFragment(a) && (l = s.pop()), r.nodeType) {\n case Node.ELEMENT_NODE:\n if (o = this.processElementNode(r, s, l), o)\n return o;\n break;\n case Node.TEXT_NODE:\n return l.appendChild(r), [...s, l];\n default:\n return [...s, l];\n }\n return [...s, ...Array.from(r.childNodes).reduce(i, [])];\n };\n return t.reduce(i, []);\n }\n /**\n * Compose paste event with passed type and detail\n *\n * @param {string} type - event type\n * @param {PasteEventDetail} detail - event detail\n */\n composePasteEvent(e, t) {\n return new CustomEvent(e, {\n detail: t\n });\n }\n};\nRn.PATTERN_PROCESSING_MAX_LENGTH = 450;\nlet pa = Rn;\nclass fa extends E {\n constructor() {\n super(...arguments), this.toolsDontSupportReadOnly = [], this.readOnlyEnabled = !1;\n }\n /**\n * Returns state of read only mode\n */\n get isEnabled() {\n return this.readOnlyEnabled;\n }\n /**\n * Set initial state\n */\n async prepare() {\n const { Tools: e } = this.Editor, { blockTools: t } = e, o = [];\n Array.from(t.entries()).forEach(([i, s]) => {\n s.isReadOnlySupported || o.push(i);\n }), this.toolsDontSupportReadOnly = o, this.config.readOnly && o.length > 0 && this.throwCriticalError(), this.toggle(this.config.readOnly, !0);\n }\n /**\n * Set read-only mode or toggle current state\n * Call all Modules `toggleReadOnly` method and re-render Editor\n *\n * @param state - (optional) read-only state or toggle\n * @param isInitial - (optional) true when editor is initializing\n */\n async toggle(e = !this.readOnlyEnabled, t = !1) {\n e && this.toolsDontSupportReadOnly.length > 0 && this.throwCriticalError();\n const o = this.readOnlyEnabled;\n this.readOnlyEnabled = e;\n for (const s in this.Editor)\n this.Editor[s].toggleReadOnly && this.Editor[s].toggleReadOnly(e);\n if (o === e)\n return this.readOnlyEnabled;\n if (t)\n return this.readOnlyEnabled;\n this.Editor.ModificationsObserver.disable();\n const i = await this.Editor.Saver.save();\n return await this.Editor.BlockManager.clear(), await this.Editor.Renderer.render(i.blocks), this.Editor.ModificationsObserver.enable(), this.readOnlyEnabled;\n }\n /**\n * Throws an error about tools which don't support read-only mode\n */\n throwCriticalError() {\n throw new Ho(\n `To enable read-only mode all connected tools should support it. Tools ${this.toolsDontSupportReadOnly.join(\", \")} don't support read-only mode.`\n );\n }\n}\nclass Be extends E {\n constructor() {\n super(...arguments), this.isRectSelectionActivated = !1, this.SCROLL_SPEED = 3, this.HEIGHT_OF_SCROLL_ZONE = 40, this.BOTTOM_SCROLL_ZONE = 1, this.TOP_SCROLL_ZONE = 2, this.MAIN_MOUSE_BUTTON = 0, this.mousedown = !1, this.isScrolling = !1, this.inScrollZone = null, this.startX = 0, this.startY = 0, this.mouseX = 0, this.mouseY = 0, this.stackOfSelected = [], this.listenerIds = [];\n }\n /**\n * CSS classes for the Block\n *\n * @returns {{wrapper: string, content: string}}\n */\n static get CSS() {\n return {\n overlay: \"codex-editor-overlay\",\n overlayContainer: \"codex-editor-overlay__container\",\n rect: \"codex-editor-overlay__rectangle\",\n topScrollZone: \"codex-editor-overlay__scroll-zone--top\",\n bottomScrollZone: \"codex-editor-overlay__scroll-zone--bottom\"\n };\n }\n /**\n * Module Preparation\n * Creating rect and hang handlers\n */\n prepare() {\n this.enableModuleBindings();\n }\n /**\n * Init rect params\n *\n * @param {number} pageX - X coord of mouse\n * @param {number} pageY - Y coord of mouse\n */\n startSelection(e, t) {\n const o = document.elementFromPoint(e - window.pageXOffset, t - window.pageYOffset);\n o.closest(`.${this.Editor.Toolbar.CSS.toolbar}`) || (this.Editor.BlockSelection.allBlocksSelected = !1, this.clearSelection(), this.stackOfSelected = []);\n const s = [\n `.${R.CSS.content}`,\n `.${this.Editor.Toolbar.CSS.toolbar}`,\n `.${this.Editor.InlineToolbar.CSS.inlineToolbar}`\n ], r = o.closest(\".\" + this.Editor.UI.CSS.editorWrapper), a = s.some((l) => !!o.closest(l));\n !r || a || (this.mousedown = !0, this.startX = e, this.startY = t);\n }\n /**\n * Clear all params to end selection\n */\n endSelection() {\n this.mousedown = !1, this.startX = 0, this.startY = 0, this.overlayRectangle.style.display = \"none\";\n }\n /**\n * is RectSelection Activated\n */\n isRectActivated() {\n return this.isRectSelectionActivated;\n }\n /**\n * Mark that selection is end\n */\n clearSelection() {\n this.isRectSelectionActivated = !1;\n }\n /**\n * Sets Module necessary event handlers\n */\n enableModuleBindings() {\n const { container: e } = this.genHTML();\n this.listeners.on(e, \"mousedown\", (t) => {\n this.processMouseDown(t);\n }, !1), this.listeners.on(document.body, \"mousemove\", dt((t) => {\n this.processMouseMove(t);\n }, 10), {\n passive: !0\n }), this.listeners.on(document.body, \"mouseleave\", () => {\n this.processMouseLeave();\n }), this.listeners.on(window, \"scroll\", dt((t) => {\n this.processScroll(t);\n }, 10), {\n passive: !0\n }), this.listeners.on(document.body, \"mouseup\", () => {\n this.processMouseUp();\n }, !1);\n }\n /**\n * Handle mouse down events\n *\n * @param {MouseEvent} mouseEvent - mouse event payload\n */\n processMouseDown(e) {\n if (e.button !== this.MAIN_MOUSE_BUTTON)\n return;\n e.target.closest(d.allInputsSelector) !== null || this.startSelection(e.pageX, e.pageY);\n }\n /**\n * Handle mouse move events\n *\n * @param {MouseEvent} mouseEvent - mouse event payload\n */\n processMouseMove(e) {\n this.changingRectangle(e), this.scrollByZones(e.clientY);\n }\n /**\n * Handle mouse leave\n */\n processMouseLeave() {\n this.clearSelection(), this.endSelection();\n }\n /**\n * @param {MouseEvent} mouseEvent - mouse event payload\n */\n processScroll(e) {\n this.changingRectangle(e);\n }\n /**\n * Handle mouse up\n */\n processMouseUp() {\n this.clearSelection(), this.endSelection();\n }\n /**\n * Scroll If mouse in scroll zone\n *\n * @param {number} clientY - Y coord of mouse\n */\n scrollByZones(e) {\n if (this.inScrollZone = null, e <= this.HEIGHT_OF_SCROLL_ZONE && (this.inScrollZone = this.TOP_SCROLL_ZONE), document.documentElement.clientHeight - e <= this.HEIGHT_OF_SCROLL_ZONE && (this.inScrollZone = this.BOTTOM_SCROLL_ZONE), !this.inScrollZone) {\n this.isScrolling = !1;\n return;\n }\n this.isScrolling || (this.scrollVertical(this.inScrollZone === this.TOP_SCROLL_ZONE ? -this.SCROLL_SPEED : this.SCROLL_SPEED), this.isScrolling = !0);\n }\n /**\n * Generates required HTML elements\n *\n * @returns {Object<string, Element>}\n */\n genHTML() {\n const { UI: e } = this.Editor, t = e.nodes.holder.querySelector(\".\" + e.CSS.editorWrapper), o = d.make(\"div\", Be.CSS.overlay, {}), i = d.make(\"div\", Be.CSS.overlayContainer, {}), s = d.make(\"div\", Be.CSS.rect, {});\n return i.appendChild(s), o.appendChild(i), t.appendChild(o), this.overlayRectangle = s, {\n container: t,\n overlay: o\n };\n }\n /**\n * Activates scrolling if blockSelection is active and mouse is in scroll zone\n *\n * @param {number} speed - speed of scrolling\n */\n scrollVertical(e) {\n if (!(this.inScrollZone && this.mousedown))\n return;\n const t = window.pageYOffset;\n window.scrollBy(0, e), this.mouseY += window.pageYOffset - t, setTimeout(() => {\n this.scrollVertical(e);\n }, 0);\n }\n /**\n * Handles the change in the rectangle and its effect\n *\n * @param {MouseEvent} event - mouse event\n */\n changingRectangle(e) {\n if (!this.mousedown)\n return;\n e.pageY !== void 0 && (this.mouseX = e.pageX, this.mouseY = e.pageY);\n const { rightPos: t, leftPos: o, index: i } = this.genInfoForMouseSelection(), s = this.startX > t && this.mouseX > t, r = this.startX < o && this.mouseX < o;\n this.rectCrossesBlocks = !(s || r), this.isRectSelectionActivated || (this.rectCrossesBlocks = !1, this.isRectSelectionActivated = !0, this.shrinkRectangleToPoint(), this.overlayRectangle.style.display = \"block\"), this.updateRectangleSize(), this.Editor.Toolbar.close(), i !== void 0 && (this.trySelectNextBlock(i), this.inverseSelection(), b.get().removeAllRanges());\n }\n /**\n * Shrink rect to singular point\n */\n shrinkRectangleToPoint() {\n this.overlayRectangle.style.left = `${this.startX - window.pageXOffset}px`, this.overlayRectangle.style.top = `${this.startY - window.pageYOffset}px`, this.overlayRectangle.style.bottom = `calc(100% - ${this.startY - window.pageYOffset}px`, this.overlayRectangle.style.right = `calc(100% - ${this.startX - window.pageXOffset}px`;\n }\n /**\n * Select or unselect all of blocks in array if rect is out or in selectable area\n */\n inverseSelection() {\n const t = this.Editor.BlockManager.getBlockByIndex(this.stackOfSelected[0]).selected;\n if (this.rectCrossesBlocks && !t)\n for (const o of this.stackOfSelected)\n this.Editor.BlockSelection.selectBlockByIndex(o);\n if (!this.rectCrossesBlocks && t)\n for (const o of this.stackOfSelected)\n this.Editor.BlockSelection.unSelectBlockByIndex(o);\n }\n /**\n * Updates size of rectangle\n */\n updateRectangleSize() {\n this.mouseY >= this.startY ? (this.overlayRectangle.style.top = `${this.startY - window.pageYOffset}px`, this.overlayRectangle.style.bottom = `calc(100% - ${this.mouseY - window.pageYOffset}px`) : (this.overlayRectangle.style.bottom = `calc(100% - ${this.startY - window.pageYOffset}px`, this.overlayRectangle.style.top = `${this.mouseY - window.pageYOffset}px`), this.mouseX >= this.startX ? (this.overlayRectangle.style.left = `${this.startX - window.pageXOffset}px`, this.overlayRectangle.style.right = `calc(100% - ${this.mouseX - window.pageXOffset}px`) : (this.overlayRectangle.style.right = `calc(100% - ${this.startX - window.pageXOffset}px`, this.overlayRectangle.style.left = `${this.mouseX - window.pageXOffset}px`);\n }\n /**\n * Collects information needed to determine the behavior of the rectangle\n *\n * @returns {object} index - index next Block, leftPos - start of left border of Block, rightPos - right border\n */\n genInfoForMouseSelection() {\n const t = document.body.offsetWidth / 2, o = this.mouseY - window.pageYOffset, i = document.elementFromPoint(t, o), s = this.Editor.BlockManager.getBlockByChildNode(i);\n let r;\n s !== void 0 && (r = this.Editor.BlockManager.blocks.findIndex((h) => h.holder === s.holder));\n const a = this.Editor.BlockManager.lastBlock.holder.querySelector(\".\" + R.CSS.content), l = Number.parseInt(window.getComputedStyle(a).width, 10) / 2, c = t - l, u = t + l;\n return {\n index: r,\n leftPos: c,\n rightPos: u\n };\n }\n /**\n * Select block with index index\n *\n * @param index - index of block in redactor\n */\n addBlockInSelection(e) {\n this.rectCrossesBlocks && this.Editor.BlockSelection.selectBlockByIndex(e), this.stackOfSelected.push(e);\n }\n /**\n * Adds a block to the selection and determines which blocks should be selected\n *\n * @param {object} index - index of new block in the reactor\n */\n trySelectNextBlock(e) {\n const t = this.stackOfSelected[this.stackOfSelected.length - 1] === e, o = this.stackOfSelected.length, i = 1, s = -1, r = 0;\n if (t)\n return;\n const a = this.stackOfSelected[o - 1] - this.stackOfSelected[o - 2] > 0;\n let l = r;\n o > 1 && (l = a ? i : s);\n const c = e > this.stackOfSelected[o - 1] && l === i, u = e < this.stackOfSelected[o - 1] && l === s, p = !(c || u || l === r);\n if (!p && (e > this.stackOfSelected[o - 1] || this.stackOfSelected[o - 1] === void 0)) {\n let v = this.stackOfSelected[o - 1] + 1 || e;\n for (v; v <= e; v++)\n this.addBlockInSelection(v);\n return;\n }\n if (!p && e < this.stackOfSelected[o - 1]) {\n for (let v = this.stackOfSelected[o - 1] - 1; v >= e; v--)\n this.addBlockInSelection(v);\n return;\n }\n if (!p)\n return;\n let g = o - 1, f;\n for (e > this.stackOfSelected[o - 1] ? f = () => e > this.stackOfSelected[g] : f = () => e < this.stackOfSelected[g]; f(); )\n this.rectCrossesBlocks && this.Editor.BlockSelection.unSelectBlockByIndex(this.stackOfSelected[g]), this.stackOfSelected.pop(), g--;\n }\n}\nclass ga extends E {\n /**\n * Renders passed blocks as one batch\n *\n * @param blocksData - blocks to render\n */\n async render(e) {\n return new Promise((t) => {\n const { Tools: o, BlockManager: i } = this.Editor;\n if (e.length === 0)\n i.insert();\n else {\n const s = e.map(({ type: r, data: a, tunes: l, id: c }) => {\n o.available.has(r) === !1 && (X(`Tool \u00AB${r}\u00BB is not found. Check 'tools' property at the Editor.js config.`, \"warn\"), a = this.composeStubDataForTool(r, a, c), r = o.stubTool);\n let u;\n try {\n u = i.composeBlock({\n id: c,\n tool: r,\n data: a,\n tunes: l\n });\n } catch (h) {\n S(`Block \u00AB${r}\u00BB skipped because of plugins error`, \"error\", {\n data: a,\n error: h\n }), a = this.composeStubDataForTool(r, a, c), r = o.stubTool, u = i.composeBlock({\n id: c,\n tool: r,\n data: a,\n tunes: l\n });\n }\n return u;\n });\n i.insertMany(s);\n }\n window.requestIdleCallback(() => {\n t();\n }, { timeout: 2e3 });\n });\n }\n /**\n * Create data for the Stub Tool that will be used instead of unavailable tool\n *\n * @param tool - unavailable tool name to stub\n * @param data - data of unavailable block\n * @param [id] - id of unavailable block\n */\n composeStubDataForTool(e, t, o) {\n const { Tools: i } = this.Editor;\n let s = e;\n if (i.unavailable.has(e)) {\n const r = i.unavailable.get(e).toolbox;\n r !== void 0 && r[0].title !== void 0 && (s = r[0].title);\n }\n return {\n savedData: {\n id: o,\n type: e,\n data: t\n },\n title: s\n };\n }\n}\nclass ma extends E {\n /**\n * Composes new chain of Promises to fire them alternatelly\n *\n * @returns {OutputData}\n */\n async save() {\n const { BlockManager: e, Tools: t } = this.Editor, o = e.blocks, i = [];\n try {\n o.forEach((a) => {\n i.push(this.getSavedData(a));\n });\n const s = await Promise.all(i), r = await yt(s, (a) => t.blockTools.get(a).sanitizeConfig);\n return this.makeOutput(r);\n } catch (s) {\n X(\"Saving failed due to the Error %o\", \"error\", s);\n }\n }\n /**\n * Saves and validates\n *\n * @param {Block} block - Editor's Tool\n * @returns {ValidatedData} - Tool's validated data\n */\n async getSavedData(e) {\n const t = await e.save(), o = t && await e.validate(t.data);\n return {\n ...t,\n isValid: o\n };\n }\n /**\n * Creates output object with saved data, time and version of editor\n *\n * @param {ValidatedData} allExtractedData - data extracted from Blocks\n * @returns {OutputData}\n */\n makeOutput(e) {\n const t = [];\n return e.forEach(({ id: o, tool: i, data: s, tunes: r, isValid: a }) => {\n if (!a) {\n S(`Block \u00AB${i}\u00BB skipped because saved data is invalid`);\n return;\n }\n if (i === this.Editor.Tools.stubTool) {\n t.push(s);\n return;\n }\n const l = {\n id: o,\n type: i,\n data: s,\n ...!V(r) && {\n tunes: r\n }\n };\n t.push(l);\n }), {\n time: +/* @__PURE__ */ new Date(),\n blocks: t,\n version: \"2.31.0-rc.7\"\n };\n }\n}\n(function() {\n try {\n if (typeof document < \"u\") {\n var n = document.createElement(\"style\");\n n.appendChild(document.createTextNode(\".ce-paragraph{line-height:1.6em;outline:none}.ce-block:only-of-type .ce-paragraph[data-placeholder-active]:empty:before,.ce-block:only-of-type .ce-paragraph[data-placeholder-active][data-empty=true]:before{content:attr(data-placeholder-active)}.ce-paragraph p:first-of-type{margin-top:0}.ce-paragraph p:last-of-type{margin-bottom:0}\")), document.head.appendChild(n);\n }\n } catch (e) {\n console.error(\"vite-plugin-css-injected-by-js\", e);\n }\n})();\nconst ba = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M8 9V7.2C8 7.08954 8.08954 7 8.2 7L12 7M16 9V7.2C16 7.08954 15.9105 7 15.8 7L12 7M12 7L12 17M12 17H10M12 17H14\"/></svg>';\nfunction va(n) {\n const e = document.createElement(\"div\");\n e.innerHTML = n.trim();\n const t = document.createDocumentFragment();\n return t.append(...Array.from(e.childNodes)), t;\n}\n/**\n * Base Paragraph Block for the Editor.js.\n * Represents a regular text block\n *\n * @author CodeX (team@codex.so)\n * @copyright CodeX 2018\n * @license The MIT License (MIT)\n */\nclass fo {\n /**\n * Default placeholder for Paragraph Tool\n *\n * @returns {string}\n * @class\n */\n static get DEFAULT_PLACEHOLDER() {\n return \"\";\n }\n /**\n * Render plugin`s main Element and fill it with saved data\n *\n * @param {object} params - constructor params\n * @param {ParagraphData} params.data - previously saved data\n * @param {ParagraphConfig} params.config - user config for Tool\n * @param {object} params.api - editor.js api\n * @param {boolean} readOnly - read only mode flag\n */\n constructor({ data: e, config: t, api: o, readOnly: i }) {\n this.api = o, this.readOnly = i, this._CSS = {\n block: this.api.styles.block,\n wrapper: \"ce-paragraph\"\n }, this.readOnly || (this.onKeyUp = this.onKeyUp.bind(this)), this._placeholder = t.placeholder ? t.placeholder : fo.DEFAULT_PLACEHOLDER, this._data = e ?? {}, this._element = null, this._preserveBlank = t.preserveBlank ?? !1;\n }\n /**\n * Check if text content is empty and set empty string to inner html.\n * We need this because some browsers (e.g. Safari) insert <br> into empty contenteditanle elements\n *\n * @param {KeyboardEvent} e - key up event\n */\n onKeyUp(e) {\n if (e.code !== \"Backspace\" && e.code !== \"Delete\" || !this._element)\n return;\n const { textContent: t } = this._element;\n t === \"\" && (this._element.innerHTML = \"\");\n }\n /**\n * Create Tool's view\n *\n * @returns {HTMLDivElement}\n * @private\n */\n drawView() {\n const e = document.createElement(\"DIV\");\n return e.classList.add(this._CSS.wrapper, this._CSS.block), e.contentEditable = \"false\", e.dataset.placeholderActive = this.api.i18n.t(this._placeholder), this._data.text && (e.innerHTML = this._data.text), this.readOnly || (e.contentEditable = \"true\", e.addEventListener(\"keyup\", this.onKeyUp)), e;\n }\n /**\n * Return Tool's view\n *\n * @returns {HTMLDivElement}\n */\n render() {\n return this._element = this.drawView(), this._element;\n }\n /**\n * Method that specified how to merge two Text blocks.\n * Called by Editor.js by backspace at the beginning of the Block\n *\n * @param {ParagraphData} data\n * @public\n */\n merge(e) {\n if (!this._element)\n return;\n this._data.text += e.text;\n const t = va(e.text);\n this._element.appendChild(t), this._element.normalize();\n }\n /**\n * Validate Paragraph block data:\n * - check for emptiness\n *\n * @param {ParagraphData} savedData \u2014 data received after saving\n * @returns {boolean} false if saved data is not correct, otherwise true\n * @public\n */\n validate(e) {\n return !(e.text.trim() === \"\" && !this._preserveBlank);\n }\n /**\n * Extract Tool's data from the view\n *\n * @param {HTMLDivElement} toolsContent - Paragraph tools rendered view\n * @returns {ParagraphData} - saved data\n * @public\n */\n save(e) {\n return {\n text: e.innerHTML\n };\n }\n /**\n * On paste callback fired from Editor.\n *\n * @param {HTMLPasteEvent} event - event with pasted data\n */\n onPaste(e) {\n const t = {\n text: e.detail.data.innerHTML\n };\n this._data = t, window.requestAnimationFrame(() => {\n this._element && (this._element.innerHTML = this._data.text || \"\");\n });\n }\n /**\n * Enable Conversion Toolbar. Paragraph can be converted to/from other tools\n * @returns {ConversionConfig}\n */\n static get conversionConfig() {\n return {\n export: \"text\",\n // to convert Paragraph to other block, use 'text' property of saved data\n import: \"text\"\n // to covert other block's exported string to Paragraph, fill 'text' property of tool data\n };\n }\n /**\n * Sanitizer rules\n * @returns {SanitizerConfig} - Edtior.js sanitizer config\n */\n static get sanitize() {\n return {\n text: {\n br: !0\n }\n };\n }\n /**\n * Returns true to notify the core that read-only mode is supported\n *\n * @returns {boolean}\n */\n static get isReadOnlySupported() {\n return !0;\n }\n /**\n * Used by Editor paste handling API.\n * Provides configuration to handle P tags.\n *\n * @returns {PasteConfig} - Paragraph Paste Setting\n */\n static get pasteConfig() {\n return {\n tags: [\"P\"]\n };\n }\n /**\n * Icon and title for displaying at the Toolbox\n *\n * @returns {ToolboxConfig} - Paragraph Toolbox Setting\n */\n static get toolbox() {\n return {\n icon: ba,\n title: \"Text\"\n };\n }\n}\nclass go {\n constructor() {\n this.commandName = \"bold\";\n }\n /**\n * Sanitizer Rule\n * Leave <b> tags\n *\n * @returns {object}\n */\n static get sanitize() {\n return {\n b: {}\n };\n }\n /**\n * Create button for Inline Toolbar\n */\n render() {\n return {\n icon: Ki,\n name: \"bold\",\n onActivate: () => {\n document.execCommand(this.commandName);\n },\n isActive: () => document.queryCommandState(this.commandName)\n };\n }\n /**\n * Set a shortcut\n *\n * @returns {boolean}\n */\n get shortcut() {\n return \"CMD+B\";\n }\n}\ngo.isInline = !0;\ngo.title = \"Bold\";\nclass mo {\n constructor() {\n this.commandName = \"italic\", this.CSS = {\n button: \"ce-inline-tool\",\n buttonActive: \"ce-inline-tool--active\",\n buttonModifier: \"ce-inline-tool--italic\"\n }, this.nodes = {\n button: null\n };\n }\n /**\n * Sanitizer Rule\n * Leave <i> tags\n *\n * @returns {object}\n */\n static get sanitize() {\n return {\n i: {}\n };\n }\n /**\n * Create button for Inline Toolbar\n */\n render() {\n return this.nodes.button = document.createElement(\"button\"), this.nodes.button.type = \"button\", this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier), this.nodes.button.innerHTML = Ji, this.nodes.button;\n }\n /**\n * Wrap range with <i> tag\n */\n surround() {\n document.execCommand(this.commandName);\n }\n /**\n * Check selection and set activated state to button if there are <i> tag\n */\n checkState() {\n const e = document.queryCommandState(this.commandName);\n return this.nodes.button.classList.toggle(this.CSS.buttonActive, e), e;\n }\n /**\n * Set a shortcut\n */\n get shortcut() {\n return \"CMD+I\";\n }\n}\nmo.isInline = !0;\nmo.title = \"Italic\";\nclass bo {\n /**\n * @param api - Editor.js API\n */\n constructor({ api: e }) {\n this.commandLink = \"createLink\", this.commandUnlink = \"unlink\", this.ENTER_KEY = 13, this.CSS = {\n button: \"ce-inline-tool\",\n buttonActive: \"ce-inline-tool--active\",\n buttonModifier: \"ce-inline-tool--link\",\n buttonUnlink: \"ce-inline-tool--unlink\",\n input: \"ce-inline-tool-input\",\n inputShowed: \"ce-inline-tool-input--showed\"\n }, this.nodes = {\n button: null,\n input: null\n }, this.inputOpened = !1, this.toolbar = e.toolbar, this.inlineToolbar = e.inlineToolbar, this.notifier = e.notifier, this.i18n = e.i18n, this.selection = new b();\n }\n /**\n * Sanitizer Rule\n * Leave <a> tags\n *\n * @returns {object}\n */\n static get sanitize() {\n return {\n a: {\n href: !0,\n target: \"_blank\",\n rel: \"nofollow\"\n }\n };\n }\n /**\n * Create button for Inline Toolbar\n */\n render() {\n return this.nodes.button = document.createElement(\"button\"), this.nodes.button.type = \"button\", this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier), this.nodes.button.innerHTML = Co, this.nodes.button;\n }\n /**\n * Input for the link\n */\n renderActions() {\n return this.nodes.input = document.createElement(\"input\"), this.nodes.input.placeholder = this.i18n.t(\"Add a link\"), this.nodes.input.enterKeyHint = \"done\", this.nodes.input.classList.add(this.CSS.input), this.nodes.input.addEventListener(\"keydown\", (e) => {\n e.keyCode === this.ENTER_KEY && this.enterPressed(e);\n }), this.nodes.input;\n }\n /**\n * Handle clicks on the Inline Toolbar icon\n *\n * @param {Range} range - range to wrap with link\n */\n surround(e) {\n if (e) {\n this.inputOpened ? (this.selection.restore(), this.selection.removeFakeBackground()) : (this.selection.setFakeBackground(), this.selection.save());\n const t = this.selection.findParentTag(\"A\");\n if (t) {\n this.selection.expandToTag(t), this.unlink(), this.closeActions(), this.checkState(), this.toolbar.close();\n return;\n }\n }\n this.toggleActions();\n }\n /**\n * Check selection and set activated state to button if there are <a> tag\n */\n checkState() {\n const e = this.selection.findParentTag(\"A\");\n if (e) {\n this.nodes.button.innerHTML = ns, this.nodes.button.classList.add(this.CSS.buttonUnlink), this.nodes.button.classList.add(this.CSS.buttonActive), this.openActions();\n const t = e.getAttribute(\"href\");\n this.nodes.input.value = t !== \"null\" ? t : \"\", this.selection.save();\n } else\n this.nodes.button.innerHTML = Co, this.nodes.button.classList.remove(this.CSS.buttonUnlink), this.nodes.button.classList.remove(this.CSS.buttonActive);\n return !!e;\n }\n /**\n * Function called with Inline Toolbar closing\n */\n clear() {\n this.closeActions();\n }\n /**\n * Set a shortcut\n */\n get shortcut() {\n return \"CMD+K\";\n }\n /**\n * Show/close link input\n */\n toggleActions() {\n this.inputOpened ? this.closeActions(!1) : this.openActions(!0);\n }\n /**\n * @param {boolean} needFocus - on link creation we need to focus input. On editing - nope.\n */\n openActions(e = !1) {\n this.nodes.input.classList.add(this.CSS.inputShowed), e && this.nodes.input.focus(), this.inputOpened = !0;\n }\n /**\n * Close input\n *\n * @param {boolean} clearSavedSelection \u2014 we don't need to clear saved selection\n * on toggle-clicks on the icon of opened Toolbar\n */\n closeActions(e = !0) {\n if (this.selection.isFakeBackgroundEnabled) {\n const t = new b();\n t.save(), this.selection.restore(), this.selection.removeFakeBackground(), t.restore();\n }\n this.nodes.input.classList.remove(this.CSS.inputShowed), this.nodes.input.value = \"\", e && this.selection.clearSaved(), this.inputOpened = !1;\n }\n /**\n * Enter pressed on input\n *\n * @param {KeyboardEvent} event - enter keydown event\n */\n enterPressed(e) {\n let t = this.nodes.input.value || \"\";\n if (!t.trim()) {\n this.selection.restore(), this.unlink(), e.preventDefault(), this.closeActions();\n return;\n }\n if (!this.validateURL(t)) {\n this.notifier.show({\n message: \"Pasted link is not valid.\",\n style: \"error\"\n }), S(\"Incorrect Link pasted\", \"warn\", t);\n return;\n }\n t = this.prepareLink(t), this.selection.restore(), this.selection.removeFakeBackground(), this.insertLink(t), e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), this.selection.collapseToEnd(), this.inlineToolbar.close();\n }\n /**\n * Detects if passed string is URL\n *\n * @param {string} str - string to validate\n * @returns {boolean}\n */\n validateURL(e) {\n return !/\\s/.test(e);\n }\n /**\n * Process link before injection\n * - sanitize\n * - add protocol for links like 'google.com'\n *\n * @param {string} link - raw user input\n */\n prepareLink(e) {\n return e = e.trim(), e = this.addProtocol(e), e;\n }\n /**\n * Add 'http' protocol to the links like 'vc.ru', 'google.com'\n *\n * @param {string} link - string to process\n */\n addProtocol(e) {\n if (/^(\\w+):(\\/\\/)?/.test(e))\n return e;\n const t = /^\\/[^/\\s]/.test(e), o = e.substring(0, 1) === \"#\", i = /^\\/\\/[^/\\s]/.test(e);\n return !t && !o && !i && (e = \"http://\" + e), e;\n }\n /**\n * Inserts <a> tag with \"href\"\n *\n * @param {string} link - \"href\" value\n */\n insertLink(e) {\n const t = this.selection.findParentTag(\"A\");\n t && this.selection.expandToTag(t), document.execCommand(this.commandLink, !1, e);\n }\n /**\n * Removes <a> tag\n */\n unlink() {\n document.execCommand(this.commandUnlink);\n }\n}\nbo.isInline = !0;\nbo.title = \"Link\";\nclass Fn {\n /**\n * @param api - Editor.js API\n */\n constructor({ api: e }) {\n this.i18nAPI = e.i18n, this.blocksAPI = e.blocks, this.selectionAPI = e.selection, this.toolsAPI = e.tools, this.caretAPI = e.caret;\n }\n /**\n * Returns tool's UI config\n */\n async render() {\n const e = b.get(), t = this.blocksAPI.getBlockByElement(e.anchorNode);\n if (t === void 0)\n return [];\n const o = this.toolsAPI.getBlockTools(), i = await Yo(t, o);\n if (i.length === 0)\n return [];\n const s = i.reduce((c, u) => {\n var h;\n return (h = u.toolbox) == null || h.forEach((p) => {\n c.push({\n icon: p.icon,\n title: z.t(K.toolNames, p.title),\n name: u.name,\n closeOnActivate: !0,\n onActivate: async () => {\n const g = await this.blocksAPI.convert(t.id, u.name, p.data);\n this.caretAPI.setToBlock(g, \"end\");\n }\n });\n }), c;\n }, []), r = await t.getActiveToolboxEntry(), a = r !== void 0 ? r.icon : Go, l = !be();\n return {\n icon: a,\n name: \"convert-to\",\n hint: {\n title: this.i18nAPI.t(\"Convert to\")\n },\n children: {\n searchable: l,\n items: s,\n onOpen: () => {\n l && (this.selectionAPI.setFakeBackground(), this.selectionAPI.save());\n },\n onClose: () => {\n l && (this.selectionAPI.restore(), this.selectionAPI.removeFakeBackground());\n }\n }\n };\n }\n}\nFn.isInline = !0;\nclass jn {\n /**\n * @param options - constructor options\n * @param options.data - stub tool data\n * @param options.api - Editor.js API\n */\n constructor({ data: e, api: t }) {\n this.CSS = {\n wrapper: \"ce-stub\",\n info: \"ce-stub__info\",\n title: \"ce-stub__title\",\n subtitle: \"ce-stub__subtitle\"\n }, this.api = t, this.title = e.title || this.api.i18n.t(\"Error\"), this.subtitle = this.api.i18n.t(\"The block can not be displayed correctly.\"), this.savedData = e.savedData, this.wrapper = this.make();\n }\n /**\n * Returns stub holder\n *\n * @returns {HTMLElement}\n */\n render() {\n return this.wrapper;\n }\n /**\n * Return original Tool data\n *\n * @returns {BlockToolData}\n */\n save() {\n return this.savedData;\n }\n /**\n * Create Tool html markup\n *\n * @returns {HTMLElement}\n */\n make() {\n const e = d.make(\"div\", this.CSS.wrapper), t = is, o = d.make(\"div\", this.CSS.info), i = d.make(\"div\", this.CSS.title, {\n textContent: this.title\n }), s = d.make(\"div\", this.CSS.subtitle, {\n textContent: this.subtitle\n });\n return e.innerHTML = t, o.appendChild(i), o.appendChild(s), e.appendChild(o), e;\n }\n}\njn.isReadOnlySupported = !0;\nclass ka extends Tt {\n constructor() {\n super(...arguments), this.type = ae.Inline;\n }\n /**\n * Returns title for Inline Tool if specified by user\n */\n get title() {\n return this.constructable[We.Title];\n }\n /**\n * Constructs new InlineTool instance from constructable\n */\n create() {\n return new this.constructable({\n api: this.api,\n config: this.settings\n });\n }\n /**\n * Allows inline tool to be available in read-only mode\n * Can be used, for example, by comments tool\n */\n get isReadOnlySupported() {\n return this.constructable[We.IsReadOnlySupported] ?? !1;\n }\n}\nclass ya extends Tt {\n constructor() {\n super(...arguments), this.type = ae.Tune;\n }\n /**\n * Constructs new BlockTune instance from constructable\n *\n * @param data - Tune data\n * @param block - Block API object\n */\n create(e, t) {\n return new this.constructable({\n api: this.api,\n config: this.settings,\n block: t,\n data: e\n });\n }\n}\nclass j extends Map {\n /**\n * Returns Block Tools collection\n */\n get blockTools() {\n const e = Array.from(this.entries()).filter(([, t]) => t.isBlock());\n return new j(e);\n }\n /**\n * Returns Inline Tools collection\n */\n get inlineTools() {\n const e = Array.from(this.entries()).filter(([, t]) => t.isInline());\n return new j(e);\n }\n /**\n * Returns Block Tunes collection\n */\n get blockTunes() {\n const e = Array.from(this.entries()).filter(([, t]) => t.isTune());\n return new j(e);\n }\n /**\n * Returns internal Tools collection\n */\n get internalTools() {\n const e = Array.from(this.entries()).filter(([, t]) => t.isInternal);\n return new j(e);\n }\n /**\n * Returns Tools collection provided by user\n */\n get externalTools() {\n const e = Array.from(this.entries()).filter(([, t]) => !t.isInternal);\n return new j(e);\n }\n}\nvar wa = Object.defineProperty, Ea = Object.getOwnPropertyDescriptor, Hn = (n, e, t, o) => {\n for (var i = o > 1 ? void 0 : o ? Ea(e, t) : e, s = n.length - 1, r; s >= 0; s--)\n (r = n[s]) && (i = (o ? r(e, t, i) : r(i)) || i);\n return o && i && wa(e, t, i), i;\n};\nclass vo extends Tt {\n constructor() {\n super(...arguments), this.type = ae.Block, this.inlineTools = new j(), this.tunes = new j();\n }\n /**\n * Creates new Tool instance\n *\n * @param data - Tool data\n * @param block - BlockAPI for current Block\n * @param readOnly - True if Editor is in read-only mode\n */\n create(e, t, o) {\n return new this.constructable({\n data: e,\n block: t,\n readOnly: o,\n api: this.api,\n config: this.settings\n });\n }\n /**\n * Returns true if read-only mode is supported by Tool\n */\n get isReadOnlySupported() {\n return this.constructable[pe.IsReadOnlySupported] === !0;\n }\n /**\n * Returns true if Tool supports linebreaks\n */\n get isLineBreaksEnabled() {\n return this.constructable[pe.IsEnabledLineBreaks];\n }\n /**\n * Returns Tool toolbox configuration (internal or user-specified).\n *\n * Merges internal and user-defined toolbox configs based on the following rules:\n *\n * - If both internal and user-defined toolbox configs are arrays their items are merged.\n * Length of the second one is kept.\n *\n * - If both are objects their properties are merged.\n *\n * - If one is an object and another is an array than internal config is replaced with user-defined\n * config. This is made to allow user to override default tool's toolbox representation (single/multiple entries)\n */\n get toolbox() {\n const e = this.constructable[pe.Toolbox], t = this.config[Pe.Toolbox];\n if (!V(e) && t !== !1)\n return t ? Array.isArray(e) ? Array.isArray(t) ? t.map((o, i) => {\n const s = e[i];\n return s ? {\n ...s,\n ...o\n } : o;\n }) : [t] : Array.isArray(t) ? t : [\n {\n ...e,\n ...t\n }\n ] : Array.isArray(e) ? e : [e];\n }\n /**\n * Returns Tool conversion configuration\n */\n get conversionConfig() {\n return this.constructable[pe.ConversionConfig];\n }\n /**\n * Returns enabled inline tools for Tool\n */\n get enabledInlineTools() {\n return this.config[Pe.EnabledInlineTools] || !1;\n }\n /**\n * Returns enabled tunes for Tool\n */\n get enabledBlockTunes() {\n return this.config[Pe.EnabledBlockTunes];\n }\n /**\n * Returns Tool paste configuration\n */\n get pasteConfig() {\n return this.constructable[pe.PasteConfig] ?? {};\n }\n get sanitizeConfig() {\n const e = super.sanitizeConfig, t = this.baseSanitizeConfig;\n if (V(e))\n return t;\n const o = {};\n for (const i in e)\n if (Object.prototype.hasOwnProperty.call(e, i)) {\n const s = e[i];\n D(s) ? o[i] = Object.assign({}, t, s) : o[i] = s;\n }\n return o;\n }\n get baseSanitizeConfig() {\n const e = {};\n return Array.from(this.inlineTools.values()).forEach((t) => Object.assign(e, t.sanitizeConfig)), Array.from(this.tunes.values()).forEach((t) => Object.assign(e, t.sanitizeConfig)), e;\n }\n}\nHn([\n me\n], vo.prototype, \"sanitizeConfig\", 1);\nHn([\n me\n], vo.prototype, \"baseSanitizeConfig\", 1);\nclass xa {\n /**\n * @class\n * @param config - tools config\n * @param editorConfig - EditorJS config\n * @param api - EditorJS API module\n */\n constructor(e, t, o) {\n this.api = o, this.config = e, this.editorConfig = t;\n }\n /**\n * Returns Tool object based on it's type\n *\n * @param name - tool name\n */\n get(e) {\n const { class: t, isInternal: o = !1, ...i } = this.config[e], s = this.getConstructor(t), r = t[mt.IsTune];\n return new s({\n name: e,\n constructable: t,\n config: i,\n api: this.api.getMethodsForTool(e, r),\n isDefault: e === this.editorConfig.defaultBlock,\n defaultPlaceholder: this.editorConfig.placeholder,\n isInternal: o\n });\n }\n /**\n * Find appropriate Tool object constructor for Tool constructable\n *\n * @param constructable - Tools constructable\n */\n getConstructor(e) {\n switch (!0) {\n case e[We.IsInline]:\n return ka;\n case e[mt.IsTune]:\n return ya;\n default:\n return vo;\n }\n }\n}\nclass $n {\n /**\n * MoveDownTune constructor\n *\n * @param {API} api \u2014 Editor's API\n */\n constructor({ api: e }) {\n this.CSS = {\n animation: \"wobble\"\n }, this.api = e;\n }\n /**\n * Tune's appearance in block settings menu\n */\n render() {\n return {\n icon: Xi,\n title: this.api.i18n.t(\"Move down\"),\n onActivate: () => this.handleClick(),\n name: \"move-down\"\n };\n }\n /**\n * Handle clicks on 'move down' button\n */\n handleClick() {\n const e = this.api.blocks.getCurrentBlockIndex(), t = this.api.blocks.getBlockByIndex(e + 1);\n if (!t)\n throw new Error(\"Unable to move Block down since it is already the last\");\n const o = t.holder, i = o.getBoundingClientRect();\n let s = Math.abs(window.innerHeight - o.offsetHeight);\n i.top < window.innerHeight && (s = window.scrollY + o.offsetHeight), window.scrollTo(0, s), this.api.blocks.move(e + 1), this.api.toolbar.toggleBlockSettings(!0);\n }\n}\n$n.isTune = !0;\nclass zn {\n /**\n * DeleteTune constructor\n *\n * @param {API} api - Editor's API\n */\n constructor({ api: e }) {\n this.api = e;\n }\n /**\n * Tune's appearance in block settings menu\n */\n render() {\n return {\n icon: Gi,\n title: this.api.i18n.t(\"Delete\"),\n name: \"delete\",\n confirmation: {\n title: this.api.i18n.t(\"Click to delete\"),\n onActivate: () => this.handleClick()\n }\n };\n }\n /**\n * Delete block conditions passed\n */\n handleClick() {\n this.api.blocks.delete();\n }\n}\nzn.isTune = !0;\nclass Un {\n /**\n * MoveUpTune constructor\n *\n * @param {API} api - Editor's API\n */\n constructor({ api: e }) {\n this.CSS = {\n animation: \"wobble\"\n }, this.api = e;\n }\n /**\n * Tune's appearance in block settings menu\n */\n render() {\n return {\n icon: Zi,\n title: this.api.i18n.t(\"Move up\"),\n onActivate: () => this.handleClick(),\n name: \"move-up\"\n };\n }\n /**\n * Move current block up\n */\n handleClick() {\n const e = this.api.blocks.getCurrentBlockIndex(), t = this.api.blocks.getBlockByIndex(e), o = this.api.blocks.getBlockByIndex(e - 1);\n if (e === 0 || !t || !o)\n throw new Error(\"Unable to move Block up since it is already the first\");\n const i = t.holder, s = o.holder, r = i.getBoundingClientRect(), a = s.getBoundingClientRect();\n let l;\n a.top > 0 ? l = Math.abs(r.top) - Math.abs(a.top) : l = Math.abs(r.top) + a.height, window.scrollBy(0, -1 * l), this.api.blocks.move(e - 1), this.api.toolbar.toggleBlockSettings(!0);\n }\n}\nUn.isTune = !0;\nvar Ba = Object.defineProperty, Ca = Object.getOwnPropertyDescriptor, Ta = (n, e, t, o) => {\n for (var i = o > 1 ? void 0 : o ? Ca(e, t) : e, s = n.length - 1, r; s >= 0; s--)\n (r = n[s]) && (i = (o ? r(e, t, i) : r(i)) || i);\n return o && i && Ba(e, t, i), i;\n};\nclass Wn extends E {\n constructor() {\n super(...arguments), this.stubTool = \"stub\", this.toolsAvailable = new j(), this.toolsUnavailable = new j();\n }\n /**\n * Returns available Tools\n */\n get available() {\n return this.toolsAvailable;\n }\n /**\n * Returns unavailable Tools\n */\n get unavailable() {\n return this.toolsUnavailable;\n }\n /**\n * Return Tools for the Inline Toolbar\n */\n get inlineTools() {\n return this.available.inlineTools;\n }\n /**\n * Return editor block tools\n */\n get blockTools() {\n return this.available.blockTools;\n }\n /**\n * Return available Block Tunes\n *\n * @returns {object} - object of Inline Tool's classes\n */\n get blockTunes() {\n return this.available.blockTunes;\n }\n /**\n * Returns default Tool object\n */\n get defaultTool() {\n return this.blockTools.get(this.config.defaultBlock);\n }\n /**\n * Returns internal tools\n */\n get internal() {\n return this.available.internalTools;\n }\n /**\n * Creates instances via passed or default configuration\n *\n * @returns {Promise<void>}\n */\n async prepare() {\n if (this.validateTools(), this.config.tools = ut({}, this.internalTools, this.config.tools), !Object.prototype.hasOwnProperty.call(this.config, \"tools\") || Object.keys(this.config.tools).length === 0)\n throw Error(\"Can't start without tools\");\n const e = this.prepareConfig();\n this.factory = new xa(e, this.config, this.Editor.API);\n const t = this.getListOfPrepareFunctions(e);\n if (t.length === 0)\n return Promise.resolve();\n await Qn(t, (o) => {\n this.toolPrepareMethodSuccess(o);\n }, (o) => {\n this.toolPrepareMethodFallback(o);\n }), this.prepareBlockTools();\n }\n getAllInlineToolsSanitizeConfig() {\n const e = {};\n return Array.from(this.inlineTools.values()).forEach((t) => {\n Object.assign(e, t.sanitizeConfig);\n }), e;\n }\n /**\n * Calls each Tool reset method to clean up anything set by Tool\n */\n destroy() {\n Object.values(this.available).forEach(async (e) => {\n A(e.reset) && await e.reset();\n });\n }\n /**\n * Returns internal tools\n * Includes Bold, Italic, Link and Paragraph\n */\n get internalTools() {\n return {\n convertTo: {\n class: Fn,\n isInternal: !0\n },\n link: {\n class: bo,\n isInternal: !0\n },\n bold: {\n class: go,\n isInternal: !0\n },\n italic: {\n class: mo,\n isInternal: !0\n },\n paragraph: {\n class: fo,\n inlineToolbar: !0,\n isInternal: !0\n },\n stub: {\n class: jn,\n isInternal: !0\n },\n moveUp: {\n class: Un,\n isInternal: !0\n },\n delete: {\n class: zn,\n isInternal: !0\n },\n moveDown: {\n class: $n,\n isInternal: !0\n }\n };\n }\n /**\n * Tool prepare method success callback\n *\n * @param {object} data - append tool to available list\n */\n toolPrepareMethodSuccess(e) {\n const t = this.factory.get(e.toolName);\n if (t.isInline()) {\n const i = [\"render\"].filter((s) => !t.create()[s]);\n if (i.length) {\n S(\n `Incorrect Inline Tool: ${t.name}. Some of required methods is not implemented %o`,\n \"warn\",\n i\n ), this.toolsUnavailable.set(t.name, t);\n return;\n }\n }\n this.toolsAvailable.set(t.name, t);\n }\n /**\n * Tool prepare method fail callback\n *\n * @param {object} data - append tool to unavailable list\n */\n toolPrepareMethodFallback(e) {\n this.toolsUnavailable.set(e.toolName, this.factory.get(e.toolName));\n }\n /**\n * Binds prepare function of plugins with user or default config\n *\n * @returns {Array} list of functions that needs to be fired sequentially\n * @param config - tools config\n */\n getListOfPrepareFunctions(e) {\n const t = [];\n return Object.entries(e).forEach(([o, i]) => {\n t.push({\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n function: A(i.class.prepare) ? i.class.prepare : () => {\n },\n data: {\n toolName: o,\n config: i.config\n }\n });\n }), t;\n }\n /**\n * Assign enabled Inline Tools and Block Tunes for Block Tool\n */\n prepareBlockTools() {\n Array.from(this.blockTools.values()).forEach((e) => {\n this.assignInlineToolsToBlockTool(e), this.assignBlockTunesToBlockTool(e);\n });\n }\n /**\n * Assign enabled Inline Tools for Block Tool\n *\n * @param tool - Block Tool\n */\n assignInlineToolsToBlockTool(e) {\n if (this.config.inlineToolbar !== !1) {\n if (e.enabledInlineTools === !0) {\n e.inlineTools = new j(\n Array.isArray(this.config.inlineToolbar) ? this.config.inlineToolbar.map((t) => [t, this.inlineTools.get(t)]) : Array.from(this.inlineTools.entries())\n );\n return;\n }\n Array.isArray(e.enabledInlineTools) && (e.inlineTools = new j(\n /** Prepend ConvertTo Inline Tool */\n [\"convertTo\", ...e.enabledInlineTools].map((t) => [t, this.inlineTools.get(t)])\n ));\n }\n }\n /**\n * Assign enabled Block Tunes for Block Tool\n *\n * @param tool \u2014 Block Tool\n */\n assignBlockTunesToBlockTool(e) {\n if (e.enabledBlockTunes !== !1) {\n if (Array.isArray(e.enabledBlockTunes)) {\n const t = new j(\n e.enabledBlockTunes.map((o) => [o, this.blockTunes.get(o)])\n );\n e.tunes = new j([...t, ...this.blockTunes.internalTools]);\n return;\n }\n if (Array.isArray(this.config.tunes)) {\n const t = new j(\n this.config.tunes.map((o) => [o, this.blockTunes.get(o)])\n );\n e.tunes = new j([...t, ...this.blockTunes.internalTools]);\n return;\n }\n e.tunes = this.blockTunes.internalTools;\n }\n }\n /**\n * Validate Tools configuration objects and throw Error for user if it is invalid\n */\n validateTools() {\n for (const e in this.config.tools)\n if (Object.prototype.hasOwnProperty.call(this.config.tools, e)) {\n if (e in this.internalTools)\n return;\n const t = this.config.tools[e];\n if (!A(t) && !A(t.class))\n throw Error(\n `Tool \u00AB${e}\u00BB must be a constructor function or an object with function in the \u00ABclass\u00BB property`\n );\n }\n }\n /**\n * Unify tools config\n */\n prepareConfig() {\n const e = {};\n for (const t in this.config.tools)\n D(this.config.tools[t]) ? e[t] = this.config.tools[t] : e[t] = { class: this.config.tools[t] };\n return e;\n }\n}\nTa([\n me\n], Wn.prototype, \"getAllInlineToolsSanitizeConfig\", 1);\nconst Sa = `:root{--selectionColor: #e1f2ff;--inlineSelectionColor: #d4ecff;--bg-light: #eff2f5;--grayText: #707684;--color-dark: #1D202B;--color-active-icon: #388AE5;--color-gray-border: rgba(201, 201, 204, .48);--content-width: 650px;--narrow-mode-right-padding: 50px;--toolbox-buttons-size: 26px;--toolbox-buttons-size--mobile: 36px;--icon-size: 20px;--icon-size--mobile: 28px;--block-padding-vertical: .4em;--color-line-gray: #EFF0F1 }.codex-editor{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:1}.codex-editor .hide{display:none}.codex-editor__redactor [contenteditable]:empty:after{content:\"\\\\feff\"}@media (min-width: 651px){.codex-editor--narrow .codex-editor__redactor{margin-right:50px}}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .codex-editor__redactor{margin-left:50px;margin-right:0}}@media (min-width: 651px){.codex-editor--narrow .ce-toolbar__actions{right:-5px}}.codex-editor-copyable{position:absolute;height:1px;width:1px;top:-400%;opacity:.001}.codex-editor-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:999;pointer-events:none;overflow:hidden}.codex-editor-overlay__container{position:relative;pointer-events:auto;z-index:0}.codex-editor-overlay__rectangle{position:absolute;pointer-events:none;background-color:#2eaadc33;border:1px solid transparent}.codex-editor svg{max-height:100%}.codex-editor path{stroke:currentColor}.codex-editor ::-moz-selection{background-color:#d4ecff}.codex-editor ::selection{background-color:#d4ecff}.codex-editor--toolbox-opened [contentEditable=true][data-placeholder]:focus:before{opacity:0!important}.ce-scroll-locked{overflow:hidden}.ce-scroll-locked--hard{overflow:hidden;top:calc(-1 * var(--window-scroll-offset));position:fixed;width:100%}.ce-toolbar{position:absolute;left:0;right:0;top:0;-webkit-transition:opacity .1s ease;transition:opacity .1s ease;will-change:opacity,top;display:none}.ce-toolbar--opened{display:block}.ce-toolbar__content{max-width:650px;margin:0 auto;position:relative}.ce-toolbar__plus{color:#1d202b;cursor:pointer;width:26px;height:26px;border-radius:7px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-negative:0;flex-shrink:0}@media (max-width: 650px){.ce-toolbar__plus{width:36px;height:36px}}@media (hover: hover){.ce-toolbar__plus:hover{background-color:#eff2f5}}.ce-toolbar__plus--active{background-color:#eff2f5;-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.ce-toolbar__plus-shortcut{opacity:.6;word-spacing:-2px;margin-top:5px}@media (max-width: 650px){.ce-toolbar__plus{position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;position:static}.ce-toolbar__plus--left-oriented:before{left:15px;margin-left:0}.ce-toolbar__plus--right-oriented:before{left:auto;right:15px;margin-left:0}}.ce-toolbar__actions{position:absolute;right:100%;opacity:0;display:-webkit-box;display:-ms-flexbox;display:flex;padding-right:5px}.ce-toolbar__actions--opened{opacity:1}@media (max-width: 650px){.ce-toolbar__actions{right:auto}}.ce-toolbar__settings-btn{color:#1d202b;width:26px;height:26px;border-radius:7px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;margin-left:3px;cursor:pointer;user-select:none}@media (max-width: 650px){.ce-toolbar__settings-btn{width:36px;height:36px}}@media (hover: hover){.ce-toolbar__settings-btn:hover{background-color:#eff2f5}}.ce-toolbar__settings-btn--active{background-color:#eff2f5;-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (min-width: 651px){.ce-toolbar__settings-btn{width:24px}}.ce-toolbar__settings-btn--hidden{display:none}@media (max-width: 650px){.ce-toolbar__settings-btn{position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;position:static}.ce-toolbar__settings-btn--left-oriented:before{left:15px;margin-left:0}.ce-toolbar__settings-btn--right-oriented:before{left:auto;right:15px;margin-left:0}}.ce-toolbar__plus svg,.ce-toolbar__settings-btn svg{width:24px;height:24px}@media (min-width: 651px){.codex-editor--narrow .ce-toolbar__plus{left:5px}}@media (min-width: 651px){.codex-editor--narrow .ce-toolbox .ce-popover{right:0;left:auto;left:initial}}.ce-inline-toolbar{--y-offset: 8px;--color-background-icon-active: rgba(56, 138, 229, .1);--color-text-icon-active: #388AE5;--color-text-primary: black;position:absolute;visibility:hidden;-webkit-transition:opacity .25s ease;transition:opacity .25s ease;will-change:opacity,left,top;top:0;left:0;z-index:3;opacity:1;visibility:visible}.ce-inline-toolbar [hidden]{display:none!important}.ce-inline-toolbar__toggler-and-button-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;padding:0 6px}.ce-inline-toolbar__buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-inline-toolbar__dropdown{display:-webkit-box;display:-ms-flexbox;display:flex;padding:6px;margin:0 6px 0 -6px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-right:1px solid rgba(201,201,204,.48);-webkit-box-sizing:border-box;box-sizing:border-box}@media (hover: hover){.ce-inline-toolbar__dropdown:hover{background:#eff2f5}}.ce-inline-toolbar__dropdown--hidden{display:none}.ce-inline-toolbar__dropdown-content,.ce-inline-toolbar__dropdown-arrow{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-inline-toolbar__dropdown-content svg,.ce-inline-toolbar__dropdown-arrow svg{width:20px;height:20px}.ce-inline-toolbar__shortcut{opacity:.6;word-spacing:-3px;margin-top:3px}.ce-inline-tool{color:var(--color-text-primary);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:0;border-radius:4px;line-height:normal;height:100%;padding:0;width:28px;background-color:transparent;cursor:pointer}@media (max-width: 650px){.ce-inline-tool{width:36px;height:36px}}@media (hover: hover){.ce-inline-tool:hover{background-color:#f8f8f8}}.ce-inline-tool svg{display:block;width:20px;height:20px}@media (max-width: 650px){.ce-inline-tool svg{width:28px;height:28px}}.ce-inline-tool--link .icon--unlink,.ce-inline-tool--unlink .icon--link{display:none}.ce-inline-tool--unlink .icon--unlink{display:inline-block;margin-bottom:-1px}.ce-inline-tool-input{background:#F8F8F8;border:1px solid rgba(226,226,229,.2);border-radius:6px;padding:4px 8px;font-size:14px;line-height:22px;outline:none;margin:0;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;display:none;font-weight:500;-webkit-appearance:none;font-family:inherit}@media (max-width: 650px){.ce-inline-tool-input{font-size:15px;font-weight:500}}.ce-inline-tool-input::-webkit-input-placeholder{color:#707684}.ce-inline-tool-input::-moz-placeholder{color:#707684}.ce-inline-tool-input:-ms-input-placeholder{color:#707684}.ce-inline-tool-input::-ms-input-placeholder{color:#707684}.ce-inline-tool-input::placeholder{color:#707684}.ce-inline-tool-input--showed{display:block}.ce-inline-tool--active{background:var(--color-background-icon-active);color:var(--color-text-icon-active)}@-webkit-keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.ce-block{-webkit-animation:fade-in .3s ease;animation:fade-in .3s ease;-webkit-animation-fill-mode:none;animation-fill-mode:none;-webkit-animation-fill-mode:initial;animation-fill-mode:initial}.ce-block:first-of-type{margin-top:0}.ce-block--selected .ce-block__content{background:#e1f2ff}.ce-block--selected .ce-block__content [contenteditable]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ce-block--selected .ce-block__content img,.ce-block--selected .ce-block__content .ce-stub{opacity:.55}.ce-block--stretched .ce-block__content{max-width:none}.ce-block__content{position:relative;max-width:650px;margin:0 auto;-webkit-transition:background-color .15s ease;transition:background-color .15s ease}.ce-block--drop-target .ce-block__content:before{content:\"\";position:absolute;top:100%;left:-20px;margin-top:-1px;height:8px;width:8px;border:solid #388AE5;border-width:1px 1px 0 0;-webkit-transform-origin:right;transform-origin:right;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ce-block--drop-target .ce-block__content:after{content:\"\";position:absolute;top:100%;height:1px;width:100%;color:#388ae5;background:repeating-linear-gradient(90deg,#388AE5,#388AE5 1px,#fff 1px,#fff 6px)}.ce-block a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline}.ce-block b{font-weight:700}.ce-block i{font-style:italic}@-webkit-keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}20%{-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}60%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}20%{-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}60%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@-webkit-keyframes selectionBounce{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}50%{-webkit-transform:scale3d(1.01,1.01,1.01);transform:scale3d(1.01,1.01,1.01)}70%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes selectionBounce{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}50%{-webkit-transform:scale3d(1.01,1.01,1.01);transform:scale3d(1.01,1.01,1.01)}70%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@-webkit-keyframes buttonClicked{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.95,.95,.95);transform:scale3d(.95,.95,.95)}60%{-webkit-transform:scale3d(1.02,1.02,1.02);transform:scale3d(1.02,1.02,1.02)}80%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes buttonClicked{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.95,.95,.95);transform:scale3d(.95,.95,.95)}60%{-webkit-transform:scale3d(1.02,1.02,1.02);transform:scale3d(1.02,1.02,1.02)}80%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}.cdx-block{padding:.4em 0}.cdx-block::-webkit-input-placeholder{line-height:normal!important}.cdx-input{border:1px solid rgba(201,201,204,.48);-webkit-box-shadow:inset 0 1px 2px 0 rgba(35,44,72,.06);box-shadow:inset 0 1px 2px #232c480f;border-radius:3px;padding:10px 12px;outline:none;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.cdx-input[data-placeholder]:before{position:static!important}.cdx-input[data-placeholder]:before{display:inline-block;width:0;white-space:nowrap;pointer-events:none}.cdx-settings-button{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:3px;cursor:pointer;border:0;outline:none;background-color:transparent;vertical-align:bottom;color:inherit;margin:0;min-width:26px;min-height:26px}.cdx-settings-button--focused{background:rgba(34,186,255,.08)!important}.cdx-settings-button--focused{-webkit-box-shadow:inset 0 0 0px 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.cdx-settings-button--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}.cdx-settings-button--active{color:#388ae5}.cdx-settings-button svg{width:auto;height:auto}@media (max-width: 650px){.cdx-settings-button svg{width:28px;height:28px}}@media (max-width: 650px){.cdx-settings-button{width:36px;height:36px;border-radius:8px}}@media (hover: hover){.cdx-settings-button:hover{background-color:#eff2f5}}.cdx-loader{position:relative;border:1px solid rgba(201,201,204,.48)}.cdx-loader:before{content:\"\";position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-11px 0 0 -11px;border:2px solid rgba(201,201,204,.48);border-left-color:#388ae5;border-radius:50%;-webkit-animation:cdxRotation 1.2s infinite linear;animation:cdxRotation 1.2s infinite linear}@-webkit-keyframes cdxRotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes cdxRotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.cdx-button{padding:13px;border-radius:3px;border:1px solid rgba(201,201,204,.48);font-size:14.9px;background:#fff;-webkit-box-shadow:0 2px 2px 0 rgba(18,30,57,.04);box-shadow:0 2px 2px #121e390a;color:#707684;text-align:center;cursor:pointer}@media (hover: hover){.cdx-button:hover{background:#FBFCFE;-webkit-box-shadow:0 1px 3px 0 rgba(18,30,57,.08);box-shadow:0 1px 3px #121e3914}}.cdx-button svg{height:20px;margin-right:.2em;margin-top:-2px}.ce-stub{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:12px 18px;margin:10px 0;border-radius:10px;background:#eff2f5;border:1px solid #EFF0F1;color:#707684;font-size:14px}.ce-stub svg{width:20px;height:20px}.ce-stub__info{margin-left:14px}.ce-stub__title{font-weight:500;text-transform:capitalize}.codex-editor.codex-editor--rtl{direction:rtl}.codex-editor.codex-editor--rtl .cdx-list{padding-left:0;padding-right:40px}.codex-editor.codex-editor--rtl .ce-toolbar__plus{right:-26px;left:auto}.codex-editor.codex-editor--rtl .ce-toolbar__actions{right:auto;left:-26px}@media (max-width: 650px){.codex-editor.codex-editor--rtl .ce-toolbar__actions{margin-left:0;margin-right:auto;padding-right:0;padding-left:10px}}.codex-editor.codex-editor--rtl .ce-settings{left:5px;right:auto}.codex-editor.codex-editor--rtl .ce-settings:before{right:auto;left:25px}.codex-editor.codex-editor--rtl .ce-settings__button:not(:nth-child(3n+3)){margin-left:3px;margin-right:0}.codex-editor.codex-editor--rtl .ce-conversion-tool__icon{margin-right:0;margin-left:10px}.codex-editor.codex-editor--rtl .ce-inline-toolbar__dropdown{border-right:0px solid transparent;border-left:1px solid rgba(201,201,204,.48);margin:0 -6px 0 6px}.codex-editor.codex-editor--rtl .ce-inline-toolbar__dropdown .icon--toggler-down{margin-left:0;margin-right:4px}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .ce-toolbar__plus{left:0;right:5px}}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .ce-toolbar__actions{left:-5px}}.cdx-search-field{--icon-margin-right: 10px;background:#F8F8F8;border:1px solid rgba(226,226,229,.2);border-radius:6px;padding:2px;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:auto}.cdx-search-field__icon{width:26px;height:26px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:var(--icon-margin-right)}.cdx-search-field__icon svg{width:20px;height:20px;color:#707684}.cdx-search-field__input{font-size:14px;outline:none;font-weight:500;font-family:inherit;border:0;background:transparent;margin:0;padding:0;line-height:22px;min-width:calc(100% - 26px - var(--icon-margin-right))}.cdx-search-field__input::-webkit-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::-moz-placeholder{color:#707684;font-weight:500}.cdx-search-field__input:-ms-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::-ms-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::placeholder{color:#707684;font-weight:500}.ce-popover{--border-radius: 6px;--width: 200px;--max-height: 270px;--padding: 6px;--offset-from-target: 8px;--color-border: #EFF0F1;--color-shadow: rgba(13, 20, 33, .1);--color-background: white;--color-text-primary: black;--color-text-secondary: #707684;--color-border-icon: rgba(201, 201, 204, .48);--color-border-icon-disabled: #EFF0F1;--color-text-icon-active: #388AE5;--color-background-icon-active: rgba(56, 138, 229, .1);--color-background-item-focus: rgba(34, 186, 255, .08);--color-shadow-item-focus: rgba(7, 161, 227, .08);--color-background-item-hover: #F8F8F8;--color-background-item-confirm: #E24A4A;--color-background-item-confirm-hover: #CE4343;--popover-top: calc(100% + var(--offset-from-target));--popover-left: 0;--nested-popover-overlap: 4px;--icon-size: 20px;--item-padding: 3px;--item-height: calc(var(--icon-size) + 2 * var(--item-padding))}.ce-popover__container{min-width:var(--width);width:var(--width);max-height:var(--max-height);border-radius:var(--border-radius);overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0px 3px 15px -3px var(--color-shadow);box-shadow:0 3px 15px -3px var(--color-shadow);position:absolute;left:var(--popover-left);top:var(--popover-top);background:var(--color-background);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;z-index:4;opacity:0;max-height:0;pointer-events:none;padding:0;border:none}.ce-popover--opened>.ce-popover__container{opacity:1;padding:var(--padding);max-height:var(--max-height);pointer-events:auto;-webkit-animation:panelShowing .1s ease;animation:panelShowing .1s ease;border:1px solid var(--color-border)}@media (max-width: 650px){.ce-popover--opened>.ce-popover__container{-webkit-animation:panelShowingMobile .25s ease;animation:panelShowingMobile .25s ease}}.ce-popover--open-top .ce-popover__container{--popover-top: calc(-1 * (var(--offset-from-target) + var(--popover-height)))}.ce-popover--open-left .ce-popover__container{--popover-left: calc(-1 * var(--width) + 100%)}.ce-popover__items{overflow-y:auto;-ms-scroll-chaining:none;overscroll-behavior:contain}@media (max-width: 650px){.ce-popover__overlay{position:fixed;top:0;bottom:0;left:0;right:0;background:#1D202B;z-index:3;opacity:.5;-webkit-transition:opacity .12s ease-in;transition:opacity .12s ease-in;will-change:opacity;visibility:visible}}.ce-popover__overlay--hidden{display:none}@media (max-width: 650px){.ce-popover .ce-popover__container{--offset: 5px;position:fixed;max-width:none;min-width:calc(100% - var(--offset) * 2);left:var(--offset);right:var(--offset);bottom:calc(var(--offset) + env(safe-area-inset-bottom));top:auto;border-radius:10px}}.ce-popover__search{margin-bottom:5px}.ce-popover__nothing-found-message{color:#707684;display:none;cursor:default;padding:3px;font-size:14px;line-height:20px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ce-popover__nothing-found-message--displayed{display:block}.ce-popover--nested .ce-popover__container{--popover-left: calc(var(--nesting-level) * (var(--width) - var(--nested-popover-overlap)));top:calc(var(--trigger-item-top) - var(--nested-popover-overlap));position:absolute}.ce-popover--open-top.ce-popover--nested .ce-popover__container{top:calc(var(--trigger-item-top) - var(--popover-height) + var(--item-height) + var(--offset-from-target) + var(--nested-popover-overlap))}.ce-popover--open-left .ce-popover--nested .ce-popover__container{--popover-left: calc(-1 * (var(--nesting-level) + 1) * var(--width) + 100%)}.ce-popover-item-separator{padding:4px 3px}.ce-popover-item-separator--hidden{display:none}.ce-popover-item-separator__line{height:1px;background:var(--color-border);width:100%}.ce-popover-item-html--hidden{display:none}.ce-popover-item{--border-radius: 6px;border-radius:var(--border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:var(--item-padding);color:var(--color-text-primary);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;background:transparent}@media (max-width: 650px){.ce-popover-item{padding:4px}}.ce-popover-item:not(:last-of-type){margin-bottom:1px}.ce-popover-item__icon{width:26px;height:26px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ce-popover-item__icon svg{width:20px;height:20px}@media (max-width: 650px){.ce-popover-item__icon{width:36px;height:36px;border-radius:8px}.ce-popover-item__icon svg{width:28px;height:28px}}.ce-popover-item__icon--tool{margin-right:4px}.ce-popover-item__title{font-size:14px;line-height:20px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:auto}@media (max-width: 650px){.ce-popover-item__title{font-size:16px}}.ce-popover-item__secondary-title{color:var(--color-text-secondary);font-size:12px;white-space:nowrap;letter-spacing:-.1em;padding-right:5px;opacity:.6}@media (max-width: 650px){.ce-popover-item__secondary-title{display:none}}.ce-popover-item--active{background:var(--color-background-icon-active);color:var(--color-text-icon-active)}.ce-popover-item--disabled{color:var(--color-text-secondary);cursor:default;pointer-events:none}.ce-popover-item--focused:not(.ce-popover-item--no-focus){background:var(--color-background-item-focus)!important}.ce-popover-item--hidden{display:none}@media (hover: hover){.ce-popover-item:hover{cursor:pointer}.ce-popover-item:hover:not(.ce-popover-item--no-hover){background-color:var(--color-background-item-hover)}}.ce-popover-item--confirmation{background:var(--color-background-item-confirm)}.ce-popover-item--confirmation .ce-popover-item__title,.ce-popover-item--confirmation .ce-popover-item__icon{color:#fff}@media (hover: hover){.ce-popover-item--confirmation:not(.ce-popover-item--no-hover):hover{background:var(--color-background-item-confirm-hover)}}.ce-popover-item--confirmation:not(.ce-popover-item--no-focus).ce-popover-item--focused{background:var(--color-background-item-confirm-hover)!important}@-webkit-keyframes panelShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes panelShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes panelShowingMobile{0%{opacity:0;-webkit-transform:translateY(14px) scale(.98);transform:translateY(14px) scale(.98)}70%{opacity:1;-webkit-transform:translateY(-4px);transform:translateY(-4px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes panelShowingMobile{0%{opacity:0;-webkit-transform:translateY(14px) scale(.98);transform:translateY(14px) scale(.98)}70%{opacity:1;-webkit-transform:translateY(-4px);transform:translateY(-4px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}.wobble{-webkit-animation-name:wobble;animation-name:wobble;-webkit-animation-duration:.4s;animation-duration:.4s}@-webkit-keyframes wobble{0%{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-9%,0,0);transform:translate3d(-9%,0,0)}30%{-webkit-transform:translate3d(9%,0,0);transform:translate3d(9%,0,0)}45%{-webkit-transform:translate3d(-4%,0,0);transform:translate3d(-4%,0,0)}60%{-webkit-transform:translate3d(4%,0,0);transform:translate3d(4%,0,0)}75%{-webkit-transform:translate3d(-1%,0,0);transform:translate3d(-1%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}@keyframes wobble{0%{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-9%,0,0);transform:translate3d(-9%,0,0)}30%{-webkit-transform:translate3d(9%,0,0);transform:translate3d(9%,0,0)}45%{-webkit-transform:translate3d(-4%,0,0);transform:translate3d(-4%,0,0)}60%{-webkit-transform:translate3d(4%,0,0);transform:translate3d(4%,0,0)}75%{-webkit-transform:translate3d(-1%,0,0);transform:translate3d(-1%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}.ce-popover-header{margin-bottom:8px;margin-top:4px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ce-popover-header__text{font-size:18px;font-weight:600}.ce-popover-header__back-button{border:0;background:transparent;width:36px;height:36px;color:var(--color-text-primary)}.ce-popover-header__back-button svg{display:block;width:28px;height:28px}.ce-popover--inline{--height: 38px;--height-mobile: 46px;--container-padding: 4px;position:relative}.ce-popover--inline .ce-popover__custom-content{margin-bottom:0}.ce-popover--inline .ce-popover__items{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-popover--inline .ce-popover__container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;padding:var(--container-padding);height:var(--height);top:0;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;width:-webkit-max-content;width:-moz-max-content;width:max-content;-webkit-animation:none;animation:none}@media (max-width: 650px){.ce-popover--inline .ce-popover__container{height:var(--height-mobile);position:absolute}}.ce-popover--inline .ce-popover-item-separator{padding:0 4px}.ce-popover--inline .ce-popover-item-separator__line{height:100%;width:1px}.ce-popover--inline .ce-popover-item{border-radius:4px;padding:4px}.ce-popover--inline .ce-popover-item__icon--tool{-webkit-box-shadow:none;box-shadow:none;background:transparent;margin-right:0}.ce-popover--inline .ce-popover-item__icon{width:auto;width:initial;height:auto;height:initial}.ce-popover--inline .ce-popover-item__icon svg{width:20px;height:20px}@media (max-width: 650px){.ce-popover--inline .ce-popover-item__icon svg{width:28px;height:28px}}.ce-popover--inline .ce-popover-item:not(:last-of-type){margin-bottom:0;margin-bottom:initial}.ce-popover--inline .ce-popover-item-html{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ce-popover--inline .ce-popover-item__icon--chevron-right{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ce-popover--inline .ce-popover--nested-level-1 .ce-popover__container{--offset: 3px;left:0;top:calc(var(--height) + var(--offset))}@media (max-width: 650px){.ce-popover--inline .ce-popover--nested-level-1 .ce-popover__container{top:calc(var(--height-mobile) + var(--offset))}}.ce-popover--inline .ce-popover--nested .ce-popover__container{min-width:var(--width);width:var(--width);height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:6px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.ce-popover--inline .ce-popover--nested .ce-popover__items{display:block;width:100%}.ce-popover--inline .ce-popover--nested .ce-popover-item{border-radius:6px;padding:3px}@media (max-width: 650px){.ce-popover--inline .ce-popover--nested .ce-popover-item{padding:4px}}.ce-popover--inline .ce-popover--nested .ce-popover-item__icon--tool{margin-right:4px}.ce-popover--inline .ce-popover--nested .ce-popover-item__icon{width:26px;height:26px}.ce-popover--inline .ce-popover--nested .ce-popover-item-separator{padding:4px 3px}.ce-popover--inline .ce-popover--nested .ce-popover-item-separator__line{width:100%;height:1px}.codex-editor [data-placeholder]:empty:before,.codex-editor [data-placeholder][data-empty=true]:before{pointer-events:none;color:#707684;cursor:text;content:attr(data-placeholder)}.codex-editor [data-placeholder-active]:empty:before,.codex-editor [data-placeholder-active][data-empty=true]:before{pointer-events:none;color:#707684;cursor:text}.codex-editor [data-placeholder-active]:empty:focus:before,.codex-editor [data-placeholder-active][data-empty=true]:focus:before{content:attr(data-placeholder-active)}\n`;\nclass Ia extends E {\n constructor() {\n super(...arguments), this.isMobile = !1, this.contentRectCache = null, this.resizeDebouncer = Eo(() => {\n this.windowResize();\n }, 200), this.selectionChangeDebounced = Eo(() => {\n this.selectionChanged();\n }, da), this.documentTouchedListener = (e) => {\n this.documentTouched(e);\n };\n }\n /**\n * Editor.js UI CSS class names\n *\n * @returns {{editorWrapper: string, editorZone: string}}\n */\n get CSS() {\n return {\n editorWrapper: \"codex-editor\",\n editorWrapperNarrow: \"codex-editor--narrow\",\n editorZone: \"codex-editor__redactor\",\n editorZoneHidden: \"codex-editor__redactor--hidden\",\n editorEmpty: \"codex-editor--empty\",\n editorRtlFix: \"codex-editor--rtl\"\n };\n }\n /**\n * Return Width of center column of Editor\n *\n * @returns {DOMRect}\n */\n get contentRect() {\n if (this.contentRectCache !== null)\n return this.contentRectCache;\n const e = this.nodes.wrapper.querySelector(`.${R.CSS.content}`);\n return e ? (this.contentRectCache = e.getBoundingClientRect(), this.contentRectCache) : {\n width: 650,\n left: 0,\n right: 0\n };\n }\n /**\n * Making main interface\n */\n async prepare() {\n this.setIsMobile(), this.make(), this.loadStyles();\n }\n /**\n * Toggle read-only state\n *\n * If readOnly is true:\n * - removes all listeners from main UI module elements\n *\n * if readOnly is false:\n * - enables all listeners to UI module elements\n *\n * @param {boolean} readOnlyEnabled - \"read only\" state\n */\n toggleReadOnly(e) {\n e ? this.unbindReadOnlySensitiveListeners() : window.requestIdleCallback(() => {\n this.bindReadOnlySensitiveListeners();\n }, {\n timeout: 2e3\n });\n }\n /**\n * Check if Editor is empty and set CSS class to wrapper\n */\n checkEmptiness() {\n const { BlockManager: e } = this.Editor;\n this.nodes.wrapper.classList.toggle(this.CSS.editorEmpty, e.isEditorEmpty);\n }\n /**\n * Check if one of Toolbar is opened\n * Used to prevent global keydowns (for example, Enter) conflicts with Enter-on-toolbar\n *\n * @returns {boolean}\n */\n get someToolbarOpened() {\n const { Toolbar: e, BlockSettings: t, InlineToolbar: o } = this.Editor;\n return !!(t.opened || o.opened || e.toolbox.opened);\n }\n /**\n * Check for some Flipper-buttons is under focus\n */\n get someFlipperButtonFocused() {\n return this.Editor.Toolbar.toolbox.hasFocus() ? !0 : Object.entries(this.Editor).filter(([e, t]) => t.flipper instanceof ce).some(([e, t]) => t.flipper.hasFocus());\n }\n /**\n * Clean editor`s UI\n */\n destroy() {\n this.nodes.holder.innerHTML = \"\", this.unbindReadOnlyInsensitiveListeners();\n }\n /**\n * Close all Editor's toolbars\n */\n closeAllToolbars() {\n const { Toolbar: e, BlockSettings: t, InlineToolbar: o } = this.Editor;\n t.close(), o.close(), e.toolbox.close();\n }\n /**\n * Check for mobile mode and save the result\n */\n setIsMobile() {\n const e = window.innerWidth < Ro;\n e !== this.isMobile && this.eventsDispatcher.emit(Te, {\n isEnabled: this.isMobile\n }), this.isMobile = e;\n }\n /**\n * Makes Editor.js interface\n */\n make() {\n this.nodes.holder = d.getHolder(this.config.holder), this.nodes.wrapper = d.make(\"div\", [\n this.CSS.editorWrapper,\n ...this.isRtl ? [this.CSS.editorRtlFix] : []\n ]), this.nodes.redactor = d.make(\"div\", this.CSS.editorZone), this.nodes.holder.offsetWidth < this.contentRect.width && this.nodes.wrapper.classList.add(this.CSS.editorWrapperNarrow), this.nodes.redactor.style.paddingBottom = this.config.minHeight + \"px\", this.nodes.wrapper.appendChild(this.nodes.redactor), this.nodes.holder.appendChild(this.nodes.wrapper), this.bindReadOnlyInsensitiveListeners();\n }\n /**\n * Appends CSS\n */\n loadStyles() {\n const e = \"editor-js-styles\";\n if (d.get(e))\n return;\n const t = d.make(\"style\", null, {\n id: e,\n textContent: Sa.toString()\n });\n this.config.style && !V(this.config.style) && this.config.style.nonce && t.setAttribute(\"nonce\", this.config.style.nonce), d.prepend(document.head, t);\n }\n /**\n * Adds listeners that should work both in read-only and read-write modes\n */\n bindReadOnlyInsensitiveListeners() {\n this.listeners.on(document, \"selectionchange\", this.selectionChangeDebounced), this.listeners.on(window, \"resize\", this.resizeDebouncer, {\n passive: !0\n }), this.listeners.on(this.nodes.redactor, \"mousedown\", this.documentTouchedListener, {\n capture: !0,\n passive: !0\n }), this.listeners.on(this.nodes.redactor, \"touchstart\", this.documentTouchedListener, {\n capture: !0,\n passive: !0\n });\n }\n /**\n * Removes listeners that should work both in read-only and read-write modes\n */\n unbindReadOnlyInsensitiveListeners() {\n this.listeners.off(document, \"selectionchange\", this.selectionChangeDebounced), this.listeners.off(window, \"resize\", this.resizeDebouncer), this.listeners.off(this.nodes.redactor, \"mousedown\", this.documentTouchedListener), this.listeners.off(this.nodes.redactor, \"touchstart\", this.documentTouchedListener);\n }\n /**\n * Adds listeners that should work only in read-only mode\n */\n bindReadOnlySensitiveListeners() {\n this.readOnlyMutableListeners.on(this.nodes.redactor, \"click\", (e) => {\n this.redactorClicked(e);\n }, !1), this.readOnlyMutableListeners.on(document, \"keydown\", (e) => {\n this.documentKeydown(e);\n }, !0), this.readOnlyMutableListeners.on(document, \"mousedown\", (e) => {\n this.documentClicked(e);\n }, !0), this.watchBlockHoveredEvents(), this.enableInputsEmptyMark();\n }\n /**\n * Listen redactor mousemove to emit 'block-hovered' event\n */\n watchBlockHoveredEvents() {\n let e;\n this.readOnlyMutableListeners.on(this.nodes.redactor, \"mousemove\", dt((t) => {\n const o = t.target.closest(\".ce-block\");\n this.Editor.BlockSelection.anyBlockSelected || o && e !== o && (e = o, this.eventsDispatcher.emit(ln, {\n block: this.Editor.BlockManager.getBlockByChildNode(o)\n }));\n }, 20), {\n passive: !0\n });\n }\n /**\n * Unbind events that should work only in read-only mode\n */\n unbindReadOnlySensitiveListeners() {\n this.readOnlyMutableListeners.clearAll();\n }\n /**\n * Resize window handler\n */\n windowResize() {\n this.contentRectCache = null, this.setIsMobile();\n }\n /**\n * All keydowns on document\n *\n * @param {KeyboardEvent} event - keyboard event\n */\n documentKeydown(e) {\n switch (e.keyCode) {\n case y.ENTER:\n this.enterPressed(e);\n break;\n case y.BACKSPACE:\n case y.DELETE:\n this.backspacePressed(e);\n break;\n case y.ESC:\n this.escapePressed(e);\n break;\n default:\n this.defaultBehaviour(e);\n break;\n }\n }\n /**\n * Ignore all other document's keydown events\n *\n * @param {KeyboardEvent} event - keyboard event\n */\n defaultBehaviour(e) {\n const { currentBlock: t } = this.Editor.BlockManager, o = e.target.closest(`.${this.CSS.editorWrapper}`), i = e.altKey || e.ctrlKey || e.metaKey || e.shiftKey;\n if (t !== void 0 && o === null) {\n this.Editor.BlockEvents.keydown(e);\n return;\n }\n o || t && i || (this.Editor.BlockManager.unsetCurrentBlock(), this.Editor.Toolbar.close());\n }\n /**\n * @param {KeyboardEvent} event - keyboard event\n */\n backspacePressed(e) {\n const { BlockManager: t, BlockSelection: o, Caret: i } = this.Editor;\n if (o.anyBlockSelected && !b.isSelectionExists) {\n const s = t.removeSelectedBlocks(), r = t.insertDefaultBlockAtIndex(s, !0);\n i.setToBlock(r, i.positions.START), o.clearSelection(e), e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();\n }\n }\n /**\n * Escape pressed\n * If some of Toolbar components are opened, then close it otherwise close Toolbar\n *\n * @param {Event} event - escape keydown event\n */\n escapePressed(e) {\n this.Editor.BlockSelection.clearSelection(e), this.Editor.Toolbar.toolbox.opened ? (this.Editor.Toolbar.toolbox.close(), this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock, this.Editor.Caret.positions.END)) : this.Editor.BlockSettings.opened ? this.Editor.BlockSettings.close() : this.Editor.InlineToolbar.opened ? this.Editor.InlineToolbar.close() : this.Editor.Toolbar.close();\n }\n /**\n * Enter pressed on document\n *\n * @param {KeyboardEvent} event - keyboard event\n */\n enterPressed(e) {\n const { BlockManager: t, BlockSelection: o } = this.Editor;\n if (this.someToolbarOpened)\n return;\n const i = t.currentBlockIndex >= 0;\n if (o.anyBlockSelected && !b.isSelectionExists) {\n o.clearSelection(e), e.preventDefault(), e.stopImmediatePropagation(), e.stopPropagation();\n return;\n }\n if (!this.someToolbarOpened && i && e.target.tagName === \"BODY\") {\n const s = this.Editor.BlockManager.insert();\n e.preventDefault(), this.Editor.Caret.setToBlock(s), this.Editor.Toolbar.moveAndOpen(s);\n }\n this.Editor.BlockSelection.clearSelection(e);\n }\n /**\n * All clicks on document\n *\n * @param {MouseEvent} event - Click event\n */\n documentClicked(e) {\n var a, l;\n if (!e.isTrusted)\n return;\n const t = e.target;\n this.nodes.holder.contains(t) || b.isAtEditor || (this.Editor.BlockManager.unsetCurrentBlock(), this.Editor.Toolbar.close());\n const i = (a = this.Editor.BlockSettings.nodes.wrapper) == null ? void 0 : a.contains(t), s = (l = this.Editor.Toolbar.nodes.settingsToggler) == null ? void 0 : l.contains(t), r = i || s;\n if (this.Editor.BlockSettings.opened && !r) {\n this.Editor.BlockSettings.close();\n const c = this.Editor.BlockManager.getBlockByChildNode(t);\n this.Editor.Toolbar.moveAndOpen(c);\n }\n this.Editor.BlockSelection.clearSelection(e);\n }\n /**\n * First touch on editor\n * Fired before click\n *\n * Used to change current block \u2014 we need to do it before 'selectionChange' event.\n * Also:\n * - Move and show the Toolbar\n * - Set a Caret\n *\n * @param event - touch or mouse event\n */\n documentTouched(e) {\n let t = e.target;\n if (t === this.nodes.redactor) {\n const o = e instanceof MouseEvent ? e.clientX : e.touches[0].clientX, i = e instanceof MouseEvent ? e.clientY : e.touches[0].clientY;\n t = document.elementFromPoint(o, i);\n }\n try {\n this.Editor.BlockManager.setCurrentBlockByChildNode(t);\n } catch {\n this.Editor.RectangleSelection.isRectActivated() || this.Editor.Caret.setToTheLastBlock();\n }\n this.Editor.ReadOnly.isEnabled || this.Editor.Toolbar.moveAndOpen();\n }\n /**\n * All clicks on the redactor zone\n *\n * @param {MouseEvent} event - click event\n * @description\n * - By clicks on the Editor's bottom zone:\n * - if last Block is empty, set a Caret to this\n * - otherwise, add a new empty Block and set a Caret to that\n */\n redactorClicked(e) {\n if (!b.isCollapsed)\n return;\n const t = e.target, o = e.metaKey || e.ctrlKey;\n if (d.isAnchor(t) && o) {\n e.stopImmediatePropagation(), e.stopPropagation();\n const i = t.getAttribute(\"href\"), s = oi(i);\n ii(s);\n return;\n }\n this.processBottomZoneClick(e);\n }\n /**\n * Check if user clicks on the Editor's bottom zone:\n * - set caret to the last block\n * - or add new empty block\n *\n * @param event - click event\n */\n processBottomZoneClick(e) {\n const t = this.Editor.BlockManager.getBlockByIndex(-1), o = d.offset(t.holder).bottom, i = e.pageY, { BlockSelection: s } = this.Editor;\n if (e.target instanceof Element && e.target.isEqualNode(this.nodes.redactor) && /**\n * If there is cross block selection started, target will be equal to redactor so we need additional check\n */\n !s.anyBlockSelected && /**\n * Prevent caret jumping (to last block) when clicking between blocks\n */\n o < i) {\n e.stopImmediatePropagation(), e.stopPropagation();\n const { BlockManager: a, Caret: l, Toolbar: c } = this.Editor;\n (!a.lastBlock.tool.isDefault || !a.lastBlock.isEmpty) && a.insertAtEnd(), l.setToTheLastBlock(), c.moveAndOpen(a.lastBlock);\n }\n }\n /**\n * Handle selection changes on mobile devices\n * Uses for showing the Inline Toolbar\n */\n selectionChanged() {\n const { CrossBlockSelection: e, BlockSelection: t } = this.Editor, o = b.anchorElement;\n if (e.isCrossBlockSelectionStarted && t.anyBlockSelected && b.get().removeAllRanges(), !o) {\n b.range || this.Editor.InlineToolbar.close();\n return;\n }\n const i = o.closest(`.${R.CSS.content}`);\n (i === null || i.closest(`.${b.CSS.editorWrapper}`) !== this.nodes.wrapper) && (this.Editor.InlineToolbar.containsNode(o) || this.Editor.InlineToolbar.close(), !(o.dataset.inlineToolbar === \"true\")) || (this.Editor.BlockManager.currentBlock || this.Editor.BlockManager.setCurrentBlockByChildNode(o), this.Editor.InlineToolbar.tryToShow(!0));\n }\n /**\n * Editor.js provides and ability to show placeholders for empty contenteditable elements\n *\n * This method watches for input and focus events and toggles 'data-empty' attribute\n * to workaroud the case, when inputs contains only <br>s and has no visible content\n * Then, CSS could rely on this attribute to show placeholders\n */\n enableInputsEmptyMark() {\n function e(t) {\n const o = t.target;\n Do(o);\n }\n this.readOnlyMutableListeners.on(this.nodes.wrapper, \"input\", e), this.readOnlyMutableListeners.on(this.nodes.wrapper, \"focusin\", e), this.readOnlyMutableListeners.on(this.nodes.wrapper, \"focusout\", e);\n }\n}\nconst Oa = {\n // API Modules\n BlocksAPI: gi,\n CaretAPI: bi,\n EventsAPI: vi,\n I18nAPI: kt,\n API: ki,\n InlineToolbarAPI: yi,\n ListenersAPI: wi,\n NotifierAPI: Ci,\n ReadOnlyAPI: Ti,\n SanitizerAPI: Li,\n SaverAPI: Pi,\n SelectionAPI: Ni,\n ToolsAPI: Ri,\n StylesAPI: Di,\n ToolbarAPI: Fi,\n TooltipAPI: Ui,\n UiAPI: Wi,\n // Toolbar Modules\n BlockSettings: ms,\n Toolbar: Bs,\n InlineToolbar: Cs,\n // Modules\n BlockEvents: na,\n BlockManager: ra,\n BlockSelection: aa,\n Caret: Ye,\n CrossBlockSelection: la,\n DragNDrop: ca,\n ModificationsObserver: ha,\n Paste: pa,\n ReadOnly: fa,\n RectangleSelection: Be,\n Renderer: ga,\n Saver: ma,\n Tools: Wn,\n UI: Ia\n};\nclass _a {\n /**\n * @param {EditorConfig} config - user configuration\n */\n constructor(e) {\n this.moduleInstances = {}, this.eventsDispatcher = new Oe();\n let t, o;\n this.isReady = new Promise((i, s) => {\n t = i, o = s;\n }), Promise.resolve().then(async () => {\n this.configuration = e, this.validate(), this.init(), await this.start(), await this.render();\n const { BlockManager: i, Caret: s, UI: r, ModificationsObserver: a } = this.moduleInstances;\n r.checkEmptiness(), a.enable(), this.configuration.autofocus === !0 && this.configuration.readOnly !== !0 && s.setToBlock(i.blocks[0], s.positions.START), t();\n }).catch((i) => {\n S(`Editor.js is not ready because of ${i}`, \"error\"), o(i);\n });\n }\n /**\n * Setting for configuration\n *\n * @param {EditorConfig|string} config - Editor's config to set\n */\n set configuration(e) {\n var o, i;\n D(e) ? this.config = {\n ...e\n } : this.config = {\n holder: e\n }, ht(!!this.config.holderId, \"config.holderId\", \"config.holder\"), this.config.holderId && !this.config.holder && (this.config.holder = this.config.holderId, this.config.holderId = null), this.config.holder == null && (this.config.holder = \"editorjs\"), this.config.logLevel || (this.config.logLevel = Lo.VERBOSE), Zn(this.config.logLevel), ht(!!this.config.initialBlock, \"config.initialBlock\", \"config.defaultBlock\"), this.config.defaultBlock = this.config.defaultBlock || this.config.initialBlock || \"paragraph\", this.config.minHeight = this.config.minHeight !== void 0 ? this.config.minHeight : 300;\n const t = {\n type: this.config.defaultBlock,\n data: {}\n };\n this.config.placeholder = this.config.placeholder || !1, this.config.sanitizer = this.config.sanitizer || {\n p: !0,\n b: !0,\n a: !0\n }, this.config.hideToolbar = this.config.hideToolbar ? this.config.hideToolbar : !1, this.config.tools = this.config.tools || {}, this.config.i18n = this.config.i18n || {}, this.config.data = this.config.data || { blocks: [] }, this.config.onReady = this.config.onReady || (() => {\n }), this.config.onChange = this.config.onChange || (() => {\n }), this.config.inlineToolbar = this.config.inlineToolbar !== void 0 ? this.config.inlineToolbar : !0, (V(this.config.data) || !this.config.data.blocks || this.config.data.blocks.length === 0) && (this.config.data = { blocks: [t] }), this.config.readOnly = this.config.readOnly || !1, (o = this.config.i18n) != null && o.messages && z.setDictionary(this.config.i18n.messages), this.config.i18n.direction = ((i = this.config.i18n) == null ? void 0 : i.direction) || \"ltr\";\n }\n /**\n * Returns private property\n *\n * @returns {EditorConfig}\n */\n get configuration() {\n return this.config;\n }\n /**\n * Checks for required fields in Editor's config\n */\n validate() {\n const { holderId: e, holder: t } = this.config;\n if (e && t)\n throw Error(\"\u00ABholderId\u00BB and \u00ABholder\u00BB param can't assign at the same time.\");\n if (te(t) && !d.get(t))\n throw Error(`element with ID \u00AB${t}\u00BB is missing. Pass correct holder's ID.`);\n if (t && D(t) && !d.isElement(t))\n throw Error(\"\u00ABholder\u00BB value must be an Element node\");\n }\n /**\n * Initializes modules:\n * - make and save instances\n * - configure\n */\n init() {\n this.constructModules(), this.configureModules();\n }\n /**\n * Start Editor!\n *\n * Get list of modules that needs to be prepared and return a sequence (Promise)\n *\n * @returns {Promise<void>}\n */\n async start() {\n await [\n \"Tools\",\n \"UI\",\n \"BlockManager\",\n \"Paste\",\n \"BlockSelection\",\n \"RectangleSelection\",\n \"CrossBlockSelection\",\n \"ReadOnly\"\n ].reduce(\n (t, o) => t.then(async () => {\n try {\n await this.moduleInstances[o].prepare();\n } catch (i) {\n if (i instanceof Ho)\n throw new Error(i.message);\n S(`Module ${o} was skipped because of %o`, \"warn\", i);\n }\n }),\n Promise.resolve()\n );\n }\n /**\n * Render initial data\n */\n render() {\n return this.moduleInstances.Renderer.render(this.config.data.blocks);\n }\n /**\n * Make modules instances and save it to the @property this.moduleInstances\n */\n constructModules() {\n Object.entries(Oa).forEach(([e, t]) => {\n try {\n this.moduleInstances[e] = new t({\n config: this.configuration,\n eventsDispatcher: this.eventsDispatcher\n });\n } catch (o) {\n S(\"[constructModules]\", `Module ${e} skipped because`, \"error\", o);\n }\n });\n }\n /**\n * Modules instances configuration:\n * - pass other modules to the 'state' property\n * - ...\n */\n configureModules() {\n for (const e in this.moduleInstances)\n Object.prototype.hasOwnProperty.call(this.moduleInstances, e) && (this.moduleInstances[e].state = this.getModulesDiff(e));\n }\n /**\n * Return modules without passed name\n *\n * @param {string} name - module for witch modules difference should be calculated\n */\n getModulesDiff(e) {\n const t = {};\n for (const o in this.moduleInstances)\n o !== e && (t[o] = this.moduleInstances[o]);\n return t;\n }\n}\n/**\n * Editor.js\n *\n * @license Apache-2.0\n * @see Editor.js <https://editorjs.io>\n * @author CodeX Team <https://codex.so>\n */\nclass Aa {\n /** Editor version */\n static get version() {\n return \"2.31.0-rc.7\";\n }\n /**\n * @param {EditorConfig|string|undefined} [configuration] - user configuration\n */\n constructor(e) {\n let t = () => {\n };\n D(e) && A(e.onReady) && (t = e.onReady);\n const o = new _a(e);\n this.isReady = o.isReady.then(() => {\n this.exportAPI(o), t();\n });\n }\n /**\n * Export external API methods\n *\n * @param {Core} editor \u2014 Editor's instance\n */\n exportAPI(e) {\n const t = [\"configuration\"], o = () => {\n Object.values(e.moduleInstances).forEach((s) => {\n A(s.destroy) && s.destroy(), s.listeners.removeAll();\n }), zi(), e = null;\n for (const s in this)\n Object.prototype.hasOwnProperty.call(this, s) && delete this[s];\n Object.setPrototypeOf(this, null);\n };\n t.forEach((s) => {\n this[s] = e[s];\n }), this.destroy = o, Object.setPrototypeOf(this, e.moduleInstances.API.methods), delete this.exportAPI, Object.entries({\n blocks: {\n clear: \"clear\",\n render: \"render\"\n },\n caret: {\n focus: \"focus\"\n },\n events: {\n on: \"on\",\n off: \"off\",\n emit: \"emit\"\n },\n saver: {\n save: \"save\"\n }\n }).forEach(([s, r]) => {\n Object.entries(r).forEach(([a, l]) => {\n this[l] = e.moduleInstances.API.methods[s][a];\n });\n });\n }\n}\nexport {\n Aa as default\n};\n", "(function(){\"use strict\";try{if(typeof document<\"u\"){var e=document.createElement(\"style\");e.appendChild(document.createTextNode(\".ce-header{padding:.6em 0 3px;margin:0;line-height:1.25em;outline:none}.ce-header p,.ce-header div{padding:0!important;margin:0!important}\")),document.head.appendChild(e)}}catch(n){console.error(\"vite-plugin-css-injected-by-js\",n)}})();\nconst a = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M19 17V10.2135C19 10.1287 18.9011 10.0824 18.836 10.1367L16 12.5\"/></svg>', l = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M16 11C16 10 19 9.5 19 12C19 13.9771 16.0684 13.9997 16.0012 16.8981C15.9999 16.9533 16.0448 17 16.1 17L19.3 17\"/></svg>', o = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M16 11C16 10.5 16.8323 10 17.6 10C18.3677 10 19.5 10.311 19.5 11.5C19.5 12.5315 18.7474 12.9022 18.548 12.9823C18.5378 12.9864 18.5395 13.0047 18.5503 13.0063C18.8115 13.0456 20 13.3065 20 14.8C20 16 19.5 17 17.8 17C17.8 17 16 17 16 16.3\"/></svg>', h = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M18 10L15.2834 14.8511C15.246 14.9178 15.294 15 15.3704 15C16.8489 15 18.7561 15 20.2 15M19 17C19 15.7187 19 14.8813 19 13.6\"/></svg>', d = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M16 15.9C16 15.9 16.3768 17 17.8 17C19.5 17 20 15.6199 20 14.7C20 12.7323 17.6745 12.0486 16.1635 12.9894C16.094 13.0327 16 12.9846 16 12.9027V10.1C16 10.0448 16.0448 10 16.1 10H19.8\"/></svg>', u = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M19.5 10C16.5 10.5 16 13.3285 16 15M16 15V15C16 16.1046 16.8954 17 18 17H18.3246C19.3251 17 20.3191 16.3492 20.2522 15.3509C20.0612 12.4958 16 12.6611 16 15Z\"/></svg>', g = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M9 7L9 12M9 17V12M9 12L15 12M15 7V12M15 17L15 12\"/></svg>';\n/**\n * Header block for the Editor.js.\n *\n * @author CodeX (team@ifmo.su)\n * @copyright CodeX 2018\n * @license MIT\n * @version 2.0.0\n */\nclass v {\n constructor({ data: e, config: t, api: s, readOnly: r }) {\n this.api = s, this.readOnly = r, this._settings = t, this._data = this.normalizeData(e), this._element = this.getTag();\n }\n /**\n * Styles\n */\n get _CSS() {\n return {\n block: this.api.styles.block,\n wrapper: \"ce-header\"\n };\n }\n /**\n * Check if data is valid\n * \n * @param {any} data - data to check\n * @returns {data is HeaderData}\n * @private\n */\n isHeaderData(e) {\n return e.text !== void 0;\n }\n /**\n * Normalize input data\n *\n * @param {HeaderData} data - saved data to process\n *\n * @returns {HeaderData}\n * @private\n */\n normalizeData(e) {\n const t = { text: \"\", level: this.defaultLevel.number };\n return this.isHeaderData(e) && (t.text = e.text || \"\", e.level !== void 0 && !isNaN(parseInt(e.level.toString())) && (t.level = parseInt(e.level.toString()))), t;\n }\n /**\n * Return Tool's view\n *\n * @returns {HTMLHeadingElement}\n * @public\n */\n render() {\n return this._element;\n }\n /**\n * Returns header block tunes config\n *\n * @returns {Array}\n */\n renderSettings() {\n return this.levels.map((e) => ({\n icon: e.svg,\n label: this.api.i18n.t(`Heading ${e.number}`),\n onActivate: () => this.setLevel(e.number),\n closeOnActivate: !0,\n isActive: this.currentLevel.number === e.number,\n render: () => document.createElement(\"div\")\n }));\n }\n /**\n * Callback for Block's settings buttons\n *\n * @param {number} level - level to set\n */\n setLevel(e) {\n this.data = {\n level: e,\n text: this.data.text\n };\n }\n /**\n * Method that specified how to merge two Text blocks.\n * Called by Editor.js by backspace at the beginning of the Block\n *\n * @param {HeaderData} data - saved data to merger with current block\n * @public\n */\n merge(e) {\n this._element.insertAdjacentHTML(\"beforeend\", e.text);\n }\n /**\n * Validate Text block data:\n * - check for emptiness\n *\n * @param {HeaderData} blockData \u2014 data received after saving\n * @returns {boolean} false if saved data is not correct, otherwise true\n * @public\n */\n validate(e) {\n return e.text.trim() !== \"\";\n }\n /**\n * Extract Tool's data from the view\n *\n * @param {HTMLHeadingElement} toolsContent - Text tools rendered view\n * @returns {HeaderData} - saved data\n * @public\n */\n save(e) {\n return {\n text: e.innerHTML,\n level: this.currentLevel.number\n };\n }\n /**\n * Allow Header to be converted to/from other blocks\n */\n static get conversionConfig() {\n return {\n export: \"text\",\n // use 'text' property for other blocks\n import: \"text\"\n // fill 'text' property from other block's export string\n };\n }\n /**\n * Sanitizer Rules\n */\n static get sanitize() {\n return {\n level: !1,\n text: {}\n };\n }\n /**\n * Returns true to notify core that read-only is supported\n *\n * @returns {boolean}\n */\n static get isReadOnlySupported() {\n return !0;\n }\n /**\n * Get current Tools`s data\n *\n * @returns {HeaderData} Current data\n * @private\n */\n get data() {\n return this._data.text = this._element.innerHTML, this._data.level = this.currentLevel.number, this._data;\n }\n /**\n * Store data in plugin:\n * - at the this._data property\n * - at the HTML\n *\n * @param {HeaderData} data \u2014 data to set\n * @private\n */\n set data(e) {\n if (this._data = this.normalizeData(e), e.level !== void 0 && this._element.parentNode) {\n const t = this.getTag();\n t.innerHTML = this._element.innerHTML, this._element.parentNode.replaceChild(t, this._element), this._element = t;\n }\n e.text !== void 0 && (this._element.innerHTML = this._data.text || \"\");\n }\n /**\n * Get tag for target level\n * By default returns second-leveled header\n *\n * @returns {HTMLElement}\n */\n getTag() {\n const e = document.createElement(this.currentLevel.tag);\n return e.innerHTML = this._data.text || \"\", e.classList.add(this._CSS.wrapper), e.contentEditable = this.readOnly ? \"false\" : \"true\", e.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || \"\"), e;\n }\n /**\n * Get current level\n *\n * @returns {level}\n */\n get currentLevel() {\n let e = this.levels.find((t) => t.number === this._data.level);\n return e || (e = this.defaultLevel), e;\n }\n /**\n * Return default level\n *\n * @returns {level}\n */\n get defaultLevel() {\n if (this._settings.defaultLevel) {\n const e = this.levels.find((t) => t.number === this._settings.defaultLevel);\n if (e)\n return e;\n console.warn(\"(\u0E07'\u0300-'\u0301)\u0E07 Heading Tool: the default level specified was not found in available levels\");\n }\n return this.levels[1];\n }\n /**\n * @typedef {object} level\n * @property {number} number - level number\n * @property {string} tag - tag corresponds with level number\n * @property {string} svg - icon\n */\n /**\n * Available header levels\n *\n * @returns {level[]}\n */\n get levels() {\n const e = [\n {\n number: 1,\n tag: \"H1\",\n svg: a\n },\n {\n number: 2,\n tag: \"H2\",\n svg: l\n },\n {\n number: 3,\n tag: \"H3\",\n svg: o\n },\n {\n number: 4,\n tag: \"H4\",\n svg: h\n },\n {\n number: 5,\n tag: \"H5\",\n svg: d\n },\n {\n number: 6,\n tag: \"H6\",\n svg: u\n }\n ];\n return this._settings.levels ? e.filter(\n (t) => this._settings.levels.includes(t.number)\n ) : e;\n }\n /**\n * Handle H1-H6 tags on paste to substitute it with header Tool\n *\n * @param {PasteEvent} event - event with pasted content\n */\n onPaste(e) {\n const t = e.detail;\n if (\"data\" in t) {\n const s = t.data;\n let r = this.defaultLevel.number;\n switch (s.tagName) {\n case \"H1\":\n r = 1;\n break;\n case \"H2\":\n r = 2;\n break;\n case \"H3\":\n r = 3;\n break;\n case \"H4\":\n r = 4;\n break;\n case \"H5\":\n r = 5;\n break;\n case \"H6\":\n r = 6;\n break;\n }\n this._settings.levels && (r = this._settings.levels.reduce((n, i) => Math.abs(i - r) < Math.abs(n - r) ? i : n)), this.data = {\n level: r,\n text: s.innerHTML\n };\n }\n }\n /**\n * Used by Editor.js paste handling API.\n * Provides configuration to handle H1-H6 tags.\n *\n * @returns {{handler: (function(HTMLElement): {text: string}), tags: string[]}}\n */\n static get pasteConfig() {\n return {\n tags: [\"H1\", \"H2\", \"H3\", \"H4\", \"H5\", \"H6\"]\n };\n }\n /**\n * Get Tool toolbox settings\n * icon - Tool icon's SVG\n * title - title to show in toolbox\n *\n * @returns {{icon: string, title: string}}\n */\n static get toolbox() {\n return {\n icon: g,\n title: \"Heading\"\n };\n }\n}\nexport {\n v as default\n};\n", "(function(){\"use strict\";try{if(typeof document<\"u\"){var e=document.createElement(\"style\");e.appendChild(document.createTextNode(\".cdx-list{margin:0;padding-left:40px;outline:none}.cdx-list__item{padding:5.5px 0 5.5px 3px;line-height:1.6em}.cdx-list--unordered{list-style:disc}.cdx-list--ordered{list-style:decimal}.cdx-list-settings{display:flex}.cdx-list-settings .cdx-settings-button{width:50%}\")),document.head.appendChild(e)}}catch(t){console.error(\"vite-plugin-css-injected-by-js\",t)}})();\nconst a = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><line x1=\"9\" x2=\"19\" y1=\"7\" y2=\"7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\"/><line x1=\"9\" x2=\"19\" y1=\"12\" y2=\"12\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\"/><line x1=\"9\" x2=\"19\" y1=\"17\" y2=\"17\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M5.00001 17H4.99002\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M5.00001 12H4.99002\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M5.00001 7H4.99002\"/></svg>', o = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><line x1=\"12\" x2=\"19\" y1=\"7\" y2=\"7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\"/><line x1=\"12\" x2=\"19\" y1=\"12\" y2=\"12\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\"/><line x1=\"12\" x2=\"19\" y1=\"17\" y2=\"17\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M7.79999 14L7.79999 7.2135C7.79999 7.12872 7.7011 7.0824 7.63597 7.13668L4.79999 9.5\"/></svg>';\nclass d {\n /**\n * Notify core that read-only mode is supported\n *\n * @returns {boolean}\n */\n static get isReadOnlySupported() {\n return !0;\n }\n /**\n * Allow to use native Enter behaviour\n *\n * @returns {boolean}\n * @public\n */\n static get enableLineBreaks() {\n return !0;\n }\n /**\n * Get Tool toolbox settings\n * icon - Tool icon's SVG\n * title - title to show in toolbox\n *\n * @returns {{icon: string, title: string}}\n */\n static get toolbox() {\n return {\n icon: a,\n title: \"List\"\n };\n }\n /**\n * Render plugin`s main Element and fill it with saved data\n *\n * @param {object} params - tool constructor options\n * @param {ListData} params.data - previously saved data\n * @param {object} params.config - user config for Tool\n * @param {object} params.api - Editor.js API\n * @param {boolean} params.readOnly - read-only mode flag\n */\n constructor({ data: e, config: t, api: r, readOnly: s }) {\n this._elements = {\n wrapper: null\n }, this.api = r, this.readOnly = s, this.settings = [\n {\n name: \"unordered\",\n label: this.api.i18n.t(\"Unordered\"),\n icon: a,\n default: t.defaultStyle === \"unordered\" || !1\n },\n {\n name: \"ordered\",\n label: this.api.i18n.t(\"Ordered\"),\n icon: o,\n default: t.defaultStyle === \"ordered\" || !0\n }\n ], this._data = {\n style: this.settings.find((i) => i.default === !0).name,\n items: []\n }, this.data = e;\n }\n /**\n * Returns list tag with items\n *\n * @returns {Element}\n * @public\n */\n render() {\n return this._elements.wrapper = this.makeMainTag(this._data.style), this._data.items.length ? this._data.items.forEach((e) => {\n this._elements.wrapper.appendChild(this._make(\"li\", this.CSS.item, {\n innerHTML: e\n }));\n }) : this._elements.wrapper.appendChild(this._make(\"li\", this.CSS.item)), this.readOnly || this._elements.wrapper.addEventListener(\"keydown\", (e) => {\n const [t, r] = [13, 8];\n switch (e.keyCode) {\n case t:\n this.getOutofList(e);\n break;\n case r:\n this.backspace(e);\n break;\n }\n }, !1), this._elements.wrapper;\n }\n /**\n * @returns {ListData}\n * @public\n */\n save() {\n return this.data;\n }\n /**\n * Allow List Tool to be converted to/from other block\n *\n * @returns {{export: Function, import: Function}}\n */\n static get conversionConfig() {\n return {\n /**\n * To create exported string from list, concatenate items by dot-symbol.\n *\n * @param {ListData} data - list data to create a string from thats\n * @returns {string}\n */\n export: (e) => e.items.join(\". \"),\n /**\n * To create a list from other block's string, just put it at the first item\n *\n * @param {string} string - string to create list tool data from that\n * @returns {ListData}\n */\n import: (e) => ({\n items: [e],\n style: \"unordered\"\n })\n };\n }\n /**\n * Sanitizer rules\n *\n * @returns {object}\n */\n static get sanitize() {\n return {\n style: {},\n items: {\n br: !0\n }\n };\n }\n /**\n * Settings\n *\n * @public\n * @returns {Array}\n */\n renderSettings() {\n return this.settings.map((e) => ({\n ...e,\n isActive: this._data.style === e.name,\n closeOnActivate: !0,\n onActivate: () => this.toggleTune(e.name)\n }));\n }\n /**\n * On paste callback that is fired from Editor\n *\n * @param {PasteEvent} event - event with pasted data\n */\n onPaste(e) {\n const t = e.detail.data;\n this.data = this.pasteHandler(t);\n }\n /**\n * List Tool on paste configuration\n *\n * @public\n */\n static get pasteConfig() {\n return {\n tags: [\"OL\", \"UL\", \"LI\"]\n };\n }\n /**\n * Creates main <ul> or <ol> tag depended on style\n *\n * @param {string} style - 'ordered' or 'unordered'\n * @returns {HTMLOListElement|HTMLUListElement}\n */\n makeMainTag(e) {\n const t = e === \"ordered\" ? this.CSS.wrapperOrdered : this.CSS.wrapperUnordered, r = e === \"ordered\" ? \"ol\" : \"ul\";\n return this._make(r, [this.CSS.baseBlock, this.CSS.wrapper, t], {\n contentEditable: !this.readOnly\n });\n }\n /**\n * Toggles List style\n *\n * @param {string} style - 'ordered'|'unordered'\n */\n toggleTune(e) {\n const t = this.makeMainTag(e);\n for (; this._elements.wrapper.hasChildNodes(); )\n t.appendChild(this._elements.wrapper.firstChild);\n this._elements.wrapper.replaceWith(t), this._elements.wrapper = t, this._data.style = e;\n }\n /**\n * Styles\n *\n * @private\n */\n get CSS() {\n return {\n baseBlock: this.api.styles.block,\n wrapper: \"cdx-list\",\n wrapperOrdered: \"cdx-list--ordered\",\n wrapperUnordered: \"cdx-list--unordered\",\n item: \"cdx-list__item\"\n };\n }\n /**\n * List data setter\n *\n * @param {ListData} listData\n */\n set data(e) {\n e || (e = {}), this._data.style = e.style || this.settings.find((r) => r.default === !0).name, this._data.items = e.items || [];\n const t = this._elements.wrapper;\n t && t.parentNode.replaceChild(this.render(), t);\n }\n /**\n * Return List data\n *\n * @returns {ListData}\n */\n get data() {\n this._data.items = [];\n const e = this._elements.wrapper.querySelectorAll(`.${this.CSS.item}`);\n for (let t = 0; t < e.length; t++)\n e[t].innerHTML.replace(\"<br>\", \" \").trim() && this._data.items.push(e[t].innerHTML);\n return this._data;\n }\n /**\n * Helper for making Elements with attributes\n *\n * @param {string} tagName - new Element tag name\n * @param {Array|string} classNames - list or name of CSS classname(s)\n * @param {object} attributes - any attributes\n * @returns {Element}\n */\n _make(e, t = null, r = {}) {\n const s = document.createElement(e);\n Array.isArray(t) ? s.classList.add(...t) : t && s.classList.add(t);\n for (const i in r)\n s[i] = r[i];\n return s;\n }\n /**\n * Returns current List item by the caret position\n *\n * @returns {Element}\n */\n get currentItem() {\n let e = window.getSelection().anchorNode;\n return e.nodeType !== Node.ELEMENT_NODE && (e = e.parentNode), e.closest(`.${this.CSS.item}`);\n }\n /**\n * Get out from List Tool\n * by Enter on the empty last item\n *\n * @param {KeyboardEvent} event\n */\n getOutofList(e) {\n const t = this._elements.wrapper.querySelectorAll(\".\" + this.CSS.item);\n if (t.length < 2)\n return;\n const r = t[t.length - 1], s = this.currentItem;\n s === r && !r.textContent.trim().length && (s.parentElement.removeChild(s), this.api.blocks.insert(), this.api.caret.setToBlock(this.api.blocks.getCurrentBlockIndex()), e.preventDefault(), e.stopPropagation());\n }\n /**\n * Handle backspace\n *\n * @param {KeyboardEvent} event\n */\n backspace(e) {\n const t = this._elements.wrapper.querySelectorAll(\".\" + this.CSS.item), r = t[0];\n r && t.length < 2 && !r.innerHTML.replace(\"<br>\", \" \").trim() && e.preventDefault();\n }\n /**\n * Select LI content by CMD+A\n *\n * @param {KeyboardEvent} event\n */\n selectItem(e) {\n e.preventDefault();\n const t = window.getSelection(), r = t.anchorNode.parentNode, s = r.closest(\".\" + this.CSS.item), i = new Range();\n i.selectNodeContents(s), t.removeAllRanges(), t.addRange(i);\n }\n /**\n * Handle UL, OL and LI tags paste and returns List data\n *\n * @param {HTMLUListElement|HTMLOListElement|HTMLLIElement} element\n * @returns {ListData}\n */\n pasteHandler(e) {\n const { tagName: t } = e;\n let r;\n switch (t) {\n case \"OL\":\n r = \"ordered\";\n break;\n case \"UL\":\n case \"LI\":\n r = \"unordered\";\n }\n const s = {\n style: r,\n items: []\n };\n if (t === \"LI\")\n s.items = [e.innerHTML];\n else {\n const i = Array.from(e.querySelectorAll(\"LI\"));\n s.items = i.map((n) => n.innerHTML).filter((n) => !!n.trim());\n }\n return s;\n }\n}\nexport {\n d as default\n};\n", "(function(){\"use strict\";try{if(typeof document<\"u\"){var t=document.createElement(\"style\");t.appendChild(document.createTextNode(\".cdx-quote-icon svg{transform:rotate(180deg)}.cdx-quote{margin:0}.cdx-quote__text{min-height:158px;margin-bottom:10px}.cdx-quote [contentEditable=true][data-placeholder]:before{position:absolute;content:attr(data-placeholder);color:#707684;font-weight:400;opacity:0}.cdx-quote [contentEditable=true][data-placeholder]:empty:before{opacity:1}.cdx-quote [contentEditable=true][data-placeholder]:empty:focus:before{opacity:0}.cdx-quote-settings{display:flex}.cdx-quote-settings .cdx-settings-button{width:50%}\")),document.head.appendChild(t)}}catch(e){console.error(\"vite-plugin-css-injected-by-js\",e)}})();\nconst De = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M18 7L6 7\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M18 17H6\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M16 12L8 12\"/></svg>', He = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M17 7L5 7\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M17 17H5\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M13 12L5 12\"/></svg>', Re = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 10.8182L9 10.8182C8.80222 10.8182 8.60888 10.7649 8.44443 10.665C8.27998 10.5651 8.15181 10.4231 8.07612 10.257C8.00043 10.0909 7.98063 9.90808 8.01922 9.73174C8.0578 9.55539 8.15304 9.39341 8.29289 9.26627C8.43275 9.13913 8.61093 9.05255 8.80491 9.01747C8.99889 8.98239 9.19996 9.00039 9.38268 9.0692C9.56541 9.13801 9.72159 9.25453 9.83147 9.40403C9.94135 9.55353 10 9.72929 10 9.90909L10 12.1818C10 12.664 9.78929 13.1265 9.41421 13.4675C9.03914 13.8084 8.53043 14 8 14\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M16 10.8182L15 10.8182C14.8022 10.8182 14.6089 10.7649 14.4444 10.665C14.28 10.5651 14.1518 10.4231 14.0761 10.257C14.0004 10.0909 13.9806 9.90808 14.0192 9.73174C14.0578 9.55539 14.153 9.39341 14.2929 9.26627C14.4327 9.13913 14.6109 9.05255 14.8049 9.01747C14.9989 8.98239 15.2 9.00039 15.3827 9.0692C15.5654 9.13801 15.7216 9.25453 15.8315 9.40403C15.9414 9.55353 16 9.72929 16 9.90909L16 12.1818C16 12.664 15.7893 13.1265 15.4142 13.4675C15.0391 13.8084 14.5304 14 14 14\"/></svg>';\nvar b = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {};\nfunction Fe(e) {\n if (e.__esModule)\n return e;\n var t = e.default;\n if (typeof t == \"function\") {\n var n = function r() {\n return this instanceof r ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);\n };\n n.prototype = t.prototype;\n } else\n n = {};\n return Object.defineProperty(n, \"__esModule\", { value: !0 }), Object.keys(e).forEach(function(r) {\n var i = Object.getOwnPropertyDescriptor(e, r);\n Object.defineProperty(n, r, i.get ? i : {\n enumerable: !0,\n get: function() {\n return e[r];\n }\n });\n }), n;\n}\nvar v = {}, P = {}, j = {};\nObject.defineProperty(j, \"__esModule\", { value: !0 });\nj.allInputsSelector = We;\nfunction We() {\n var e = [\"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", \"url\"];\n return \"[contenteditable=true], textarea, input:not([type]), \" + e.map(function(t) {\n return 'input[type=\"'.concat(t, '\"]');\n }).join(\", \");\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.allInputsSelector = void 0;\n var t = j;\n Object.defineProperty(e, \"allInputsSelector\", { enumerable: !0, get: function() {\n return t.allInputsSelector;\n } });\n})(P);\nvar c = {}, T = {};\nObject.defineProperty(T, \"__esModule\", { value: !0 });\nT.isNativeInput = Ue;\nfunction Ue(e) {\n var t = [\n \"INPUT\",\n \"TEXTAREA\"\n ];\n return e && e.tagName ? t.includes(e.tagName) : !1;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isNativeInput = void 0;\n var t = T;\n Object.defineProperty(e, \"isNativeInput\", { enumerable: !0, get: function() {\n return t.isNativeInput;\n } });\n})(c);\nvar ie = {}, C = {};\nObject.defineProperty(C, \"__esModule\", { value: !0 });\nC.append = qe;\nfunction qe(e, t) {\n Array.isArray(t) ? t.forEach(function(n) {\n e.appendChild(n);\n }) : e.appendChild(t);\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.append = void 0;\n var t = C;\n Object.defineProperty(e, \"append\", { enumerable: !0, get: function() {\n return t.append;\n } });\n})(ie);\nvar L = {}, S = {};\nObject.defineProperty(S, \"__esModule\", { value: !0 });\nS.blockElements = ze;\nfunction ze() {\n return [\n \"address\",\n \"article\",\n \"aside\",\n \"blockquote\",\n \"canvas\",\n \"div\",\n \"dl\",\n \"dt\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"footer\",\n \"form\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"li\",\n \"main\",\n \"nav\",\n \"noscript\",\n \"ol\",\n \"output\",\n \"p\",\n \"pre\",\n \"ruby\",\n \"section\",\n \"table\",\n \"tbody\",\n \"thead\",\n \"tr\",\n \"tfoot\",\n \"ul\",\n \"video\"\n ];\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.blockElements = void 0;\n var t = S;\n Object.defineProperty(e, \"blockElements\", { enumerable: !0, get: function() {\n return t.blockElements;\n } });\n})(L);\nvar ae = {}, M = {};\nObject.defineProperty(M, \"__esModule\", { value: !0 });\nM.calculateBaseline = Ge;\nfunction Ge(e) {\n var t = window.getComputedStyle(e), n = parseFloat(t.fontSize), r = parseFloat(t.lineHeight) || n * 1.2, i = parseFloat(t.paddingTop), a = parseFloat(t.borderTopWidth), l = parseFloat(t.marginTop), u = n * 0.8, d = (r - n) / 2, s = l + a + i + d + u;\n return s;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.calculateBaseline = void 0;\n var t = M;\n Object.defineProperty(e, \"calculateBaseline\", { enumerable: !0, get: function() {\n return t.calculateBaseline;\n } });\n})(ae);\nvar le = {}, k = {}, w = {}, N = {};\nObject.defineProperty(N, \"__esModule\", { value: !0 });\nN.isContentEditable = Ke;\nfunction Ke(e) {\n return e.contentEditable === \"true\";\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isContentEditable = void 0;\n var t = N;\n Object.defineProperty(e, \"isContentEditable\", { enumerable: !0, get: function() {\n return t.isContentEditable;\n } });\n})(w);\nObject.defineProperty(k, \"__esModule\", { value: !0 });\nk.canSetCaret = Qe;\nvar Xe = c, Ye = w;\nfunction Qe(e) {\n var t = !0;\n if ((0, Xe.isNativeInput)(e))\n switch (e.type) {\n case \"file\":\n case \"checkbox\":\n case \"radio\":\n case \"hidden\":\n case \"submit\":\n case \"button\":\n case \"image\":\n case \"reset\":\n t = !1;\n break;\n }\n else\n t = (0, Ye.isContentEditable)(e);\n return t;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.canSetCaret = void 0;\n var t = k;\n Object.defineProperty(e, \"canSetCaret\", { enumerable: !0, get: function() {\n return t.canSetCaret;\n } });\n})(le);\nvar y = {}, I = {};\nfunction Ve(e, t, n) {\n const r = n.value !== void 0 ? \"value\" : \"get\", i = n[r], a = `#${t}Cache`;\n if (n[r] = function(...l) {\n return this[a] === void 0 && (this[a] = i.apply(this, l)), this[a];\n }, r === \"get\" && n.set) {\n const l = n.set;\n n.set = function(u) {\n delete e[a], l.apply(this, u);\n };\n }\n return n;\n}\nfunction ue() {\n const e = {\n win: !1,\n mac: !1,\n x11: !1,\n linux: !1\n }, t = Object.keys(e).find((n) => window.navigator.appVersion.toLowerCase().indexOf(n) !== -1);\n return t !== void 0 && (e[t] = !0), e;\n}\nfunction A(e) {\n return e != null && e !== \"\" && (typeof e != \"object\" || Object.keys(e).length > 0);\n}\nfunction Ze(e) {\n return !A(e);\n}\nconst Je = () => typeof window < \"u\" && window.navigator !== null && A(window.navigator.platform) && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === \"MacIntel\" && window.navigator.maxTouchPoints > 1);\nfunction xe(e) {\n const t = ue();\n return e = e.replace(/shift/gi, \"\u21E7\").replace(/backspace/gi, \"\u232B\").replace(/enter/gi, \"\u23CE\").replace(/up/gi, \"\u2191\").replace(/left/gi, \"\u2192\").replace(/down/gi, \"\u2193\").replace(/right/gi, \"\u2190\").replace(/escape/gi, \"\u238B\").replace(/insert/gi, \"Ins\").replace(/delete/gi, \"\u2421\").replace(/\\+/gi, \"+\"), t.mac ? e = e.replace(/ctrl|cmd/gi, \"\u2318\").replace(/alt/gi, \"\u2325\") : e = e.replace(/cmd/gi, \"Ctrl\").replace(/windows/gi, \"WIN\"), e;\n}\nfunction et(e) {\n return e[0].toUpperCase() + e.slice(1);\n}\nfunction tt(e) {\n const t = document.createElement(\"div\");\n t.style.position = \"absolute\", t.style.left = \"-999px\", t.style.bottom = \"-999px\", t.innerHTML = e, document.body.appendChild(t);\n const n = window.getSelection(), r = document.createRange();\n if (r.selectNode(t), n === null)\n throw new Error(\"Cannot copy text to clipboard\");\n n.removeAllRanges(), n.addRange(r), document.execCommand(\"copy\"), document.body.removeChild(t);\n}\nfunction nt(e, t, n) {\n let r;\n return (...i) => {\n const a = this, l = () => {\n r = void 0, n !== !0 && e.apply(a, i);\n }, u = n === !0 && r !== void 0;\n window.clearTimeout(r), r = window.setTimeout(l, t), u && e.apply(a, i);\n };\n}\nfunction o(e) {\n return Object.prototype.toString.call(e).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\nfunction rt(e) {\n return o(e) === \"boolean\";\n}\nfunction oe(e) {\n return o(e) === \"function\" || o(e) === \"asyncfunction\";\n}\nfunction it(e) {\n return oe(e) && /^\\s*class\\s+/.test(e.toString());\n}\nfunction at(e) {\n return o(e) === \"number\";\n}\nfunction g(e) {\n return o(e) === \"object\";\n}\nfunction lt(e) {\n return Promise.resolve(e) === e;\n}\nfunction ut(e) {\n return o(e) === \"string\";\n}\nfunction ot(e) {\n return o(e) === \"undefined\";\n}\nfunction O(e, ...t) {\n if (!t.length)\n return e;\n const n = t.shift();\n if (g(e) && g(n))\n for (const r in n)\n g(n[r]) ? (e[r] === void 0 && Object.assign(e, { [r]: {} }), O(e[r], n[r])) : Object.assign(e, { [r]: n[r] });\n return O(e, ...t);\n}\nfunction st(e, t, n) {\n const r = `\u00AB${t}\u00BB is deprecated and will be removed in the next major release. Please use the \u00AB${n}\u00BB instead.`;\n e && console.warn(r);\n}\nfunction ct(e) {\n try {\n return new URL(e).href;\n } catch {\n }\n return e.substring(0, 2) === \"//\" ? window.location.protocol + e : window.location.origin + e;\n}\nfunction dt(e) {\n return e > 47 && e < 58 || e === 32 || e === 13 || e === 229 || e > 64 && e < 91 || e > 95 && e < 112 || e > 185 && e < 193 || e > 218 && e < 223;\n}\nconst ft = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n SHIFT: 16,\n CTRL: 17,\n ALT: 18,\n ESC: 27,\n SPACE: 32,\n LEFT: 37,\n UP: 38,\n DOWN: 40,\n RIGHT: 39,\n DELETE: 46,\n META: 91,\n SLASH: 191\n}, pt = {\n LEFT: 0,\n WHEEL: 1,\n RIGHT: 2,\n BACKWARD: 3,\n FORWARD: 4\n};\nclass vt {\n constructor() {\n this.completed = Promise.resolve();\n }\n /**\n * Add new promise to queue\n * @param operation - promise should be added to queue\n */\n add(t) {\n return new Promise((n, r) => {\n this.completed = this.completed.then(t).then(n).catch(r);\n });\n }\n}\nfunction gt(e, t, n = void 0) {\n let r, i, a, l = null, u = 0;\n n || (n = {});\n const d = function() {\n u = n.leading === !1 ? 0 : Date.now(), l = null, a = e.apply(r, i), l === null && (r = i = null);\n };\n return function() {\n const s = Date.now();\n !u && n.leading === !1 && (u = s);\n const f = t - (s - u);\n return r = this, i = arguments, f <= 0 || f > t ? (l && (clearTimeout(l), l = null), u = s, a = e.apply(r, i), l === null && (r = i = null)) : !l && n.trailing !== !1 && (l = setTimeout(d, f)), a;\n };\n}\nconst mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n PromiseQueue: vt,\n beautifyShortcut: xe,\n cacheable: Ve,\n capitalize: et,\n copyTextToClipboard: tt,\n debounce: nt,\n deepMerge: O,\n deprecationAssert: st,\n getUserOS: ue,\n getValidUrl: ct,\n isBoolean: rt,\n isClass: it,\n isEmpty: Ze,\n isFunction: oe,\n isIosDevice: Je,\n isNumber: at,\n isObject: g,\n isPrintableKey: dt,\n isPromise: lt,\n isString: ut,\n isUndefined: ot,\n keyCodes: ft,\n mouseButtons: pt,\n notEmpty: A,\n throttle: gt,\n typeOf: o\n}, Symbol.toStringTag, { value: \"Module\" })), $ = /* @__PURE__ */ Fe(mt);\nObject.defineProperty(I, \"__esModule\", { value: !0 });\nI.containsOnlyInlineElements = _t;\nvar bt = $, yt = L;\nfunction _t(e) {\n var t;\n (0, bt.isString)(e) ? (t = document.createElement(\"div\"), t.innerHTML = e) : t = e;\n var n = function(r) {\n return !(0, yt.blockElements)().includes(r.tagName.toLowerCase()) && Array.from(r.children).every(n);\n };\n return Array.from(t.children).every(n);\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.containsOnlyInlineElements = void 0;\n var t = I;\n Object.defineProperty(e, \"containsOnlyInlineElements\", { enumerable: !0, get: function() {\n return t.containsOnlyInlineElements;\n } });\n})(y);\nvar se = {}, B = {}, _ = {}, D = {};\nObject.defineProperty(D, \"__esModule\", { value: !0 });\nD.make = ht;\nfunction ht(e, t, n) {\n var r;\n t === void 0 && (t = null), n === void 0 && (n = {});\n var i = document.createElement(e);\n if (Array.isArray(t)) {\n var a = t.filter(function(u) {\n return u !== void 0;\n });\n (r = i.classList).add.apply(r, a);\n } else\n t !== null && i.classList.add(t);\n for (var l in n)\n Object.prototype.hasOwnProperty.call(n, l) && (i[l] = n[l]);\n return i;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.make = void 0;\n var t = D;\n Object.defineProperty(e, \"make\", { enumerable: !0, get: function() {\n return t.make;\n } });\n})(_);\nObject.defineProperty(B, \"__esModule\", { value: !0 });\nB.fragmentToString = Ot;\nvar Et = _;\nfunction Ot(e) {\n var t = (0, Et.make)(\"div\");\n return t.appendChild(e), t.innerHTML;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.fragmentToString = void 0;\n var t = B;\n Object.defineProperty(e, \"fragmentToString\", { enumerable: !0, get: function() {\n return t.fragmentToString;\n } });\n})(se);\nvar ce = {}, H = {};\nObject.defineProperty(H, \"__esModule\", { value: !0 });\nH.getContentLength = jt;\nvar Pt = c;\nfunction jt(e) {\n var t, n;\n return (0, Pt.isNativeInput)(e) ? e.value.length : e.nodeType === Node.TEXT_NODE ? e.length : (n = (t = e.textContent) === null || t === void 0 ? void 0 : t.length) !== null && n !== void 0 ? n : 0;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.getContentLength = void 0;\n var t = H;\n Object.defineProperty(e, \"getContentLength\", { enumerable: !0, get: function() {\n return t.getContentLength;\n } });\n})(ce);\nvar R = {}, F = {}, re = b && b.__spreadArray || function(e, t, n) {\n if (n || arguments.length === 2)\n for (var r = 0, i = t.length, a; r < i; r++)\n (a || !(r in t)) && (a || (a = Array.prototype.slice.call(t, 0, r)), a[r] = t[r]);\n return e.concat(a || Array.prototype.slice.call(t));\n};\nObject.defineProperty(F, \"__esModule\", { value: !0 });\nF.getDeepestBlockElements = de;\nvar Tt = y;\nfunction de(e) {\n return (0, Tt.containsOnlyInlineElements)(e) ? [e] : Array.from(e.children).reduce(function(t, n) {\n return re(re([], t, !0), de(n), !0);\n }, []);\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.getDeepestBlockElements = void 0;\n var t = F;\n Object.defineProperty(e, \"getDeepestBlockElements\", { enumerable: !0, get: function() {\n return t.getDeepestBlockElements;\n } });\n})(R);\nvar fe = {}, W = {}, h = {}, U = {};\nObject.defineProperty(U, \"__esModule\", { value: !0 });\nU.isLineBreakTag = Ct;\nfunction Ct(e) {\n return [\n \"BR\",\n \"WBR\"\n ].includes(e.tagName);\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isLineBreakTag = void 0;\n var t = U;\n Object.defineProperty(e, \"isLineBreakTag\", { enumerable: !0, get: function() {\n return t.isLineBreakTag;\n } });\n})(h);\nvar E = {}, q = {};\nObject.defineProperty(q, \"__esModule\", { value: !0 });\nq.isSingleTag = Lt;\nfunction Lt(e) {\n return [\n \"AREA\",\n \"BASE\",\n \"BR\",\n \"COL\",\n \"COMMAND\",\n \"EMBED\",\n \"HR\",\n \"IMG\",\n \"INPUT\",\n \"KEYGEN\",\n \"LINK\",\n \"META\",\n \"PARAM\",\n \"SOURCE\",\n \"TRACK\",\n \"WBR\"\n ].includes(e.tagName);\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isSingleTag = void 0;\n var t = q;\n Object.defineProperty(e, \"isSingleTag\", { enumerable: !0, get: function() {\n return t.isSingleTag;\n } });\n})(E);\nObject.defineProperty(W, \"__esModule\", { value: !0 });\nW.getDeepestNode = pe;\nvar St = c, Mt = h, kt = E;\nfunction pe(e, t) {\n t === void 0 && (t = !1);\n var n = t ? \"lastChild\" : \"firstChild\", r = t ? \"previousSibling\" : \"nextSibling\";\n if (e.nodeType === Node.ELEMENT_NODE && e[n]) {\n var i = e[n];\n if ((0, kt.isSingleTag)(i) && !(0, St.isNativeInput)(i) && !(0, Mt.isLineBreakTag)(i))\n if (i[r])\n i = i[r];\n else if (i.parentNode !== null && i.parentNode[r])\n i = i.parentNode[r];\n else\n return i.parentNode;\n return pe(i, t);\n }\n return e;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.getDeepestNode = void 0;\n var t = W;\n Object.defineProperty(e, \"getDeepestNode\", { enumerable: !0, get: function() {\n return t.getDeepestNode;\n } });\n})(fe);\nvar ve = {}, z = {}, p = b && b.__spreadArray || function(e, t, n) {\n if (n || arguments.length === 2)\n for (var r = 0, i = t.length, a; r < i; r++)\n (a || !(r in t)) && (a || (a = Array.prototype.slice.call(t, 0, r)), a[r] = t[r]);\n return e.concat(a || Array.prototype.slice.call(t));\n};\nObject.defineProperty(z, \"__esModule\", { value: !0 });\nz.findAllInputs = $t;\nvar wt = y, Nt = R, It = P, At = c;\nfunction $t(e) {\n return Array.from(e.querySelectorAll((0, It.allInputsSelector)())).reduce(function(t, n) {\n return (0, At.isNativeInput)(n) || (0, wt.containsOnlyInlineElements)(n) ? p(p([], t, !0), [n], !1) : p(p([], t, !0), (0, Nt.getDeepestBlockElements)(n), !0);\n }, []);\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.findAllInputs = void 0;\n var t = z;\n Object.defineProperty(e, \"findAllInputs\", { enumerable: !0, get: function() {\n return t.findAllInputs;\n } });\n})(ve);\nvar ge = {}, G = {};\nObject.defineProperty(G, \"__esModule\", { value: !0 });\nG.isCollapsedWhitespaces = Bt;\nfunction Bt(e) {\n return !/[^\\t\\n\\r ]/.test(e);\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isCollapsedWhitespaces = void 0;\n var t = G;\n Object.defineProperty(e, \"isCollapsedWhitespaces\", { enumerable: !0, get: function() {\n return t.isCollapsedWhitespaces;\n } });\n})(ge);\nvar K = {}, X = {};\nObject.defineProperty(X, \"__esModule\", { value: !0 });\nX.isElement = Ht;\nvar Dt = $;\nfunction Ht(e) {\n return (0, Dt.isNumber)(e) ? !1 : !!e && !!e.nodeType && e.nodeType === Node.ELEMENT_NODE;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isElement = void 0;\n var t = X;\n Object.defineProperty(e, \"isElement\", { enumerable: !0, get: function() {\n return t.isElement;\n } });\n})(K);\nvar me = {}, Y = {}, Q = {}, V = {};\nObject.defineProperty(V, \"__esModule\", { value: !0 });\nV.isLeaf = Rt;\nfunction Rt(e) {\n return e === null ? !1 : e.childNodes.length === 0;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isLeaf = void 0;\n var t = V;\n Object.defineProperty(e, \"isLeaf\", { enumerable: !0, get: function() {\n return t.isLeaf;\n } });\n})(Q);\nvar Z = {}, J = {};\nObject.defineProperty(J, \"__esModule\", { value: !0 });\nJ.isNodeEmpty = zt;\nvar Ft = h, Wt = K, Ut = c, qt = E;\nfunction zt(e, t) {\n var n = \"\";\n return (0, qt.isSingleTag)(e) && !(0, Ft.isLineBreakTag)(e) ? !1 : ((0, Wt.isElement)(e) && (0, Ut.isNativeInput)(e) ? n = e.value : e.textContent !== null && (n = e.textContent.replace(\"\u200B\", \"\")), t !== void 0 && (n = n.replace(new RegExp(t, \"g\"), \"\")), n.trim().length === 0);\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isNodeEmpty = void 0;\n var t = J;\n Object.defineProperty(e, \"isNodeEmpty\", { enumerable: !0, get: function() {\n return t.isNodeEmpty;\n } });\n})(Z);\nObject.defineProperty(Y, \"__esModule\", { value: !0 });\nY.isEmpty = Xt;\nvar Gt = Q, Kt = Z;\nfunction Xt(e, t) {\n e.normalize();\n for (var n = [e]; n.length > 0; ) {\n var r = n.shift();\n if (r) {\n if (e = r, (0, Gt.isLeaf)(e) && !(0, Kt.isNodeEmpty)(e, t))\n return !1;\n n.push.apply(n, Array.from(e.childNodes));\n }\n }\n return !0;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isEmpty = void 0;\n var t = Y;\n Object.defineProperty(e, \"isEmpty\", { enumerable: !0, get: function() {\n return t.isEmpty;\n } });\n})(me);\nvar be = {}, x = {};\nObject.defineProperty(x, \"__esModule\", { value: !0 });\nx.isFragment = Qt;\nvar Yt = $;\nfunction Qt(e) {\n return (0, Yt.isNumber)(e) ? !1 : !!e && !!e.nodeType && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isFragment = void 0;\n var t = x;\n Object.defineProperty(e, \"isFragment\", { enumerable: !0, get: function() {\n return t.isFragment;\n } });\n})(be);\nvar ye = {}, ee = {};\nObject.defineProperty(ee, \"__esModule\", { value: !0 });\nee.isHTMLString = Zt;\nvar Vt = _;\nfunction Zt(e) {\n var t = (0, Vt.make)(\"div\");\n return t.innerHTML = e, t.childElementCount > 0;\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.isHTMLString = void 0;\n var t = ee;\n Object.defineProperty(e, \"isHTMLString\", { enumerable: !0, get: function() {\n return t.isHTMLString;\n } });\n})(ye);\nvar _e = {}, te = {};\nObject.defineProperty(te, \"__esModule\", { value: !0 });\nte.offset = Jt;\nfunction Jt(e) {\n var t = e.getBoundingClientRect(), n = window.pageXOffset || document.documentElement.scrollLeft, r = window.pageYOffset || document.documentElement.scrollTop, i = t.top + r, a = t.left + n;\n return {\n top: i,\n left: a,\n bottom: i + t.height,\n right: a + t.width\n };\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.offset = void 0;\n var t = te;\n Object.defineProperty(e, \"offset\", { enumerable: !0, get: function() {\n return t.offset;\n } });\n})(_e);\nvar he = {}, ne = {};\nObject.defineProperty(ne, \"__esModule\", { value: !0 });\nne.prepend = xt;\nfunction xt(e, t) {\n Array.isArray(t) ? (t = t.reverse(), t.forEach(function(n) {\n return e.prepend(n);\n })) : e.prepend(t);\n}\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.prepend = void 0;\n var t = ne;\n Object.defineProperty(e, \"prepend\", { enumerable: !0, get: function() {\n return t.prepend;\n } });\n})(he);\n(function(e) {\n Object.defineProperty(e, \"__esModule\", { value: !0 }), e.prepend = e.offset = e.make = e.isLineBreakTag = e.isSingleTag = e.isNodeEmpty = e.isLeaf = e.isHTMLString = e.isFragment = e.isEmpty = e.isElement = e.isContentEditable = e.isCollapsedWhitespaces = e.findAllInputs = e.isNativeInput = e.allInputsSelector = e.getDeepestNode = e.getDeepestBlockElements = e.getContentLength = e.fragmentToString = e.containsOnlyInlineElements = e.canSetCaret = e.calculateBaseline = e.blockElements = e.append = void 0;\n var t = P;\n Object.defineProperty(e, \"allInputsSelector\", { enumerable: !0, get: function() {\n return t.allInputsSelector;\n } });\n var n = c;\n Object.defineProperty(e, \"isNativeInput\", { enumerable: !0, get: function() {\n return n.isNativeInput;\n } });\n var r = ie;\n Object.defineProperty(e, \"append\", { enumerable: !0, get: function() {\n return r.append;\n } });\n var i = L;\n Object.defineProperty(e, \"blockElements\", { enumerable: !0, get: function() {\n return i.blockElements;\n } });\n var a = ae;\n Object.defineProperty(e, \"calculateBaseline\", { enumerable: !0, get: function() {\n return a.calculateBaseline;\n } });\n var l = le;\n Object.defineProperty(e, \"canSetCaret\", { enumerable: !0, get: function() {\n return l.canSetCaret;\n } });\n var u = y;\n Object.defineProperty(e, \"containsOnlyInlineElements\", { enumerable: !0, get: function() {\n return u.containsOnlyInlineElements;\n } });\n var d = se;\n Object.defineProperty(e, \"fragmentToString\", { enumerable: !0, get: function() {\n return d.fragmentToString;\n } });\n var s = ce;\n Object.defineProperty(e, \"getContentLength\", { enumerable: !0, get: function() {\n return s.getContentLength;\n } });\n var f = R;\n Object.defineProperty(e, \"getDeepestBlockElements\", { enumerable: !0, get: function() {\n return f.getDeepestBlockElements;\n } });\n var Oe = fe;\n Object.defineProperty(e, \"getDeepestNode\", { enumerable: !0, get: function() {\n return Oe.getDeepestNode;\n } });\n var Pe = ve;\n Object.defineProperty(e, \"findAllInputs\", { enumerable: !0, get: function() {\n return Pe.findAllInputs;\n } });\n var je = ge;\n Object.defineProperty(e, \"isCollapsedWhitespaces\", { enumerable: !0, get: function() {\n return je.isCollapsedWhitespaces;\n } });\n var Te = w;\n Object.defineProperty(e, \"isContentEditable\", { enumerable: !0, get: function() {\n return Te.isContentEditable;\n } });\n var Ce = K;\n Object.defineProperty(e, \"isElement\", { enumerable: !0, get: function() {\n return Ce.isElement;\n } });\n var Le = me;\n Object.defineProperty(e, \"isEmpty\", { enumerable: !0, get: function() {\n return Le.isEmpty;\n } });\n var Se = be;\n Object.defineProperty(e, \"isFragment\", { enumerable: !0, get: function() {\n return Se.isFragment;\n } });\n var Me = ye;\n Object.defineProperty(e, \"isHTMLString\", { enumerable: !0, get: function() {\n return Me.isHTMLString;\n } });\n var ke = Q;\n Object.defineProperty(e, \"isLeaf\", { enumerable: !0, get: function() {\n return ke.isLeaf;\n } });\n var we = Z;\n Object.defineProperty(e, \"isNodeEmpty\", { enumerable: !0, get: function() {\n return we.isNodeEmpty;\n } });\n var Ne = h;\n Object.defineProperty(e, \"isLineBreakTag\", { enumerable: !0, get: function() {\n return Ne.isLineBreakTag;\n } });\n var Ie = E;\n Object.defineProperty(e, \"isSingleTag\", { enumerable: !0, get: function() {\n return Ie.isSingleTag;\n } });\n var Ae = _;\n Object.defineProperty(e, \"make\", { enumerable: !0, get: function() {\n return Ae.make;\n } });\n var $e = _e;\n Object.defineProperty(e, \"offset\", { enumerable: !0, get: function() {\n return $e.offset;\n } });\n var Be = he;\n Object.defineProperty(e, \"prepend\", { enumerable: !0, get: function() {\n return Be.prepend;\n } });\n})(v);\nvar Ee = /* @__PURE__ */ ((e) => (e.Left = \"left\", e.Center = \"center\", e))(Ee || {});\nclass m {\n /**\n * Render plugin`s main Element and fill it with saved data\n * @param params - Quote Tool constructor params\n * @param params.data - previously saved data\n * @param params.config - user config for Tool\n * @param params.api - editor.js api\n * @param params.readOnly - read only mode flag\n */\n constructor({ data: t, config: n, api: r, readOnly: i, block: a }) {\n const { DEFAULT_ALIGNMENT: l } = m;\n this.api = r, this.readOnly = i, this.quotePlaceholder = r.i18n.t((n == null ? void 0 : n.quotePlaceholder) ?? m.DEFAULT_QUOTE_PLACEHOLDER), this.captionPlaceholder = r.i18n.t((n == null ? void 0 : n.captionPlaceholder) ?? m.DEFAULT_CAPTION_PLACEHOLDER), this.data = {\n text: t.text || \"\",\n caption: t.caption || \"\",\n alignment: Object.values(Ee).includes(t.alignment) ? t.alignment : (n == null ? void 0 : n.defaultAlignment) ?? l\n }, this.css = {\n baseClass: this.api.styles.block,\n wrapper: \"cdx-quote\",\n text: \"cdx-quote__text\",\n input: this.api.styles.input,\n caption: \"cdx-quote__caption\"\n }, this.block = a;\n }\n /**\n * Notify core that read-only mode is supported\n * @returns true\n */\n static get isReadOnlySupported() {\n return !0;\n }\n /**\n * Get Tool toolbox settings\n * icon - Tool icon's SVG\n * title - title to show in toolbox\n * @returns icon and title of the toolbox\n */\n static get toolbox() {\n return {\n icon: Re,\n title: \"Quote\"\n };\n }\n /**\n * Empty Quote is not empty Block\n * @returns true\n */\n static get contentless() {\n return !0;\n }\n /**\n * Allow to press Enter inside the Quote\n * @returns true\n */\n static get enableLineBreaks() {\n return !0;\n }\n /**\n * Default placeholder for quote text\n * @returns 'Enter a quote'\n */\n static get DEFAULT_QUOTE_PLACEHOLDER() {\n return \"Enter a quote\";\n }\n /**\n * Default placeholder for quote caption\n * @returns 'Enter a caption'\n */\n static get DEFAULT_CAPTION_PLACEHOLDER() {\n return \"Enter a caption\";\n }\n /**\n * Default quote alignment\n * @returns Alignment.Left\n */\n static get DEFAULT_ALIGNMENT() {\n return \"left\";\n }\n /**\n * Allow Quote to be converted to/from other blocks\n * @returns conversion config object\n */\n static get conversionConfig() {\n return {\n /**\n * To create Quote data from string, simple fill 'text' property\n */\n import: \"text\",\n /**\n * To create string from Quote data, concatenate text and caption\n * @param quoteData - Quote data object\n * @returns string\n */\n export: function(t) {\n return t.caption ? `${t.text} \u2014 ${t.caption}` : t.text;\n }\n };\n }\n /**\n * Tool`s styles\n * @returns CSS classes names\n */\n get CSS() {\n return {\n baseClass: this.api.styles.block,\n wrapper: \"cdx-quote\",\n text: \"cdx-quote__text\",\n input: this.api.styles.input,\n caption: \"cdx-quote__caption\"\n };\n }\n /**\n * Tool`s settings properties\n * @returns settings properties\n */\n get settings() {\n return [\n {\n name: \"left\",\n icon: He\n },\n {\n name: \"center\",\n icon: De\n }\n ];\n }\n /**\n * Create Quote Tool container with inputs\n * @returns blockquote DOM element - Quote Tool container\n */\n render() {\n const t = v.make(\"blockquote\", [\n this.css.baseClass,\n this.css.wrapper\n ]), n = v.make(\"div\", [this.css.input, this.css.text], {\n contentEditable: !this.readOnly,\n innerHTML: this.data.text\n }), r = v.make(\"div\", [this.css.input, this.css.caption], {\n contentEditable: !this.readOnly,\n innerHTML: this.data.caption\n });\n return n.dataset.placeholder = this.quotePlaceholder, r.dataset.placeholder = this.captionPlaceholder, t.appendChild(n), t.appendChild(r), t;\n }\n /**\n * Extract Quote data from Quote Tool element\n * @param quoteElement - Quote DOM element to save\n * @returns Quote data object\n */\n save(t) {\n const n = t.querySelector(`.${this.css.text}`), r = t.querySelector(`.${this.css.caption}`);\n return Object.assign(this.data, {\n text: (n == null ? void 0 : n.innerHTML) ?? \"\",\n caption: (r == null ? void 0 : r.innerHTML) ?? \"\"\n });\n }\n /**\n * Sanitizer rules\n * @returns sanitizer rules\n */\n static get sanitize() {\n return {\n text: {\n br: !0\n },\n caption: {\n br: !0\n },\n alignment: {}\n };\n }\n /**\n * Create wrapper for Tool`s settings buttons:\n * 1. Left alignment\n * 2. Center alignment\n * @returns settings menu\n */\n renderSettings() {\n const t = (n) => n && n[0].toUpperCase() + n.slice(1);\n return this.settings.map((n) => ({\n icon: n.icon,\n label: this.api.i18n.t(`Align ${t(n.name)}`),\n onActivate: () => this._toggleTune(n.name),\n isActive: this.data.alignment === n.name,\n closeOnActivate: !0\n }));\n }\n /**\n * Toggle quote`s alignment\n * @param tune - alignment\n */\n _toggleTune(t) {\n this.data.alignment = t, this.block.dispatchChange();\n }\n}\nexport {\n m as default\n};\n", "(function(){\"use strict\";try{if(typeof document<\"u\"){var o=document.createElement(\"style\");o.appendChild(document.createTextNode('.image-tool{--bg-color: #cdd1e0;--front-color: #388ae5;--border-color: #e8e8eb}.image-tool__image{border-radius:3px;overflow:hidden;margin-bottom:10px}.image-tool__image-picture{max-width:100%;vertical-align:bottom;display:block}.image-tool__image-preloader{width:50px;height:50px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-color:var(--bg-color);background-position:center center}.image-tool__image-preloader:after{content:\"\";position:absolute;z-index:3;width:60px;height:60px;border-radius:50%;border:2px solid var(--bg-color);border-top-color:var(--front-color);left:50%;top:50%;margin-top:-30px;margin-left:-30px;animation:image-preloader-spin 2s infinite linear;box-sizing:border-box}.image-tool__caption{display:none}.image-tool__caption[contentEditable=true][data-placeholder]:before{position:absolute!important;content:attr(data-placeholder);color:#707684;font-weight:400;display:none}.image-tool__caption[contentEditable=true][data-placeholder]:empty:before{display:block}.image-tool__caption[contentEditable=true][data-placeholder]:empty:focus:before{display:none}.image-tool--empty .image-tool__image{display:none}.image-tool--empty .image-tool__caption,.image-tool--uploading .image-tool__caption{display:none!important}.image-tool .cdx-button{display:flex;align-items:center;justify-content:center}.image-tool .cdx-button svg{height:auto;margin:0 6px 0 0}.image-tool--filled .cdx-button,.image-tool--filled .image-tool__image-preloader{display:none}.image-tool--uploading .image-tool__image{min-height:200px;display:flex;border:1px solid var(--border-color);background-color:#fff}.image-tool--uploading .image-tool__image-picture,.image-tool--uploading .cdx-button{display:none}.image-tool--withBorder .image-tool__image{border:1px solid var(--border-color)}.image-tool--withBackground .image-tool__image{padding:15px;background:var(--bg-color)}.image-tool--withBackground .image-tool__image-picture{max-width:60%;margin:0 auto}.image-tool--stretched .image-tool__image-picture{width:100%}.image-tool--caption .image-tool__caption{display:block}@keyframes image-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}')),document.head.appendChild(o)}}catch(e){console.error(\"vite-plugin-css-injected-by-js\",e)}})();\nconst R = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M11 19V19C9.13623 19 8.20435 19 7.46927 18.6955C6.48915 18.2895 5.71046 17.5108 5.30448 16.5307C5 15.7956 5 14.8638 5 13V12C5 9.19108 5 7.78661 5.67412 6.77772C5.96596 6.34096 6.34096 5.96596 6.77772 5.67412C7.78661 5 9.19108 5 12 5H13.5C14.8956 5 15.5933 5 16.1611 5.17224C17.4395 5.56004 18.44 6.56046 18.8278 7.83886C19 8.40666 19 9.10444 19 10.5V10.5\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M16 13V16M16 19V16M19 16H16M16 16H13\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6.5 17.5L17.5 6.5\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M18.9919 10.5H19.0015\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10.9919 19H11.0015\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 13L13 5\"/></svg>', I = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M18.9919 9.5H19.0015\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M14.5 5H14.5096\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M14.625 5H15C17.2091 5 19 6.79086 19 9V9.375\"/><path stroke=\"currentColor\" stroke-width=\"2\" d=\"M9.375 5L9 5C6.79086 5 5 6.79086 5 9V9.375\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9.3725 5H9.38207\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 9.5H5.00957\"/><path stroke=\"currentColor\" stroke-width=\"2\" d=\"M9.375 19H9C6.79086 19 5 17.2091 5 15V14.625\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9.3725 19H9.38207\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 14.55H5.00957\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M16 13V16M16 19V16M19 16H16M16 16H13\"/></svg>', L = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><rect width=\"14\" height=\"14\" x=\"5\" y=\"5\" stroke=\"currentColor\" stroke-width=\"2\" rx=\"4\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5.13968 15.32L8.69058 11.5661C9.02934 11.2036 9.48873 11 9.96774 11C10.4467 11 10.9061 11.2036 11.2449 11.5661L15.3871 16M13.5806 14.0664L15.0132 12.533C15.3519 12.1705 15.8113 11.9668 16.2903 11.9668C16.7693 11.9668 17.2287 12.1705 17.5675 12.533L18.841 13.9634\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M13.7778 9.33331H13.7867\"/></svg>', x = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M17 9L20 12L17 15\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M14 12H20\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7 9L4 12L7 15\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 12H10\"/></svg>', B = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M8 9V7.2C8 7.08954 8.08954 7 8.2 7L12 7M16 9V7.2C16 7.08954 15.9105 7 15.8 7L12 7M12 7L12 17M12 17H10M12 17H14\"/></svg>';\nfunction M(C, i = null, a = {}) {\n const s = document.createElement(C);\n Array.isArray(i) ? s.classList.add(...i) : i !== null && s.classList.add(i);\n for (const r in a)\n a.hasOwnProperty(r) && (s[r] = a[r]);\n return s;\n}\nvar S = /* @__PURE__ */ ((C) => (C.Empty = \"empty\", C.Uploading = \"uploading\", C.Filled = \"filled\", C))(S || {});\nclass U {\n /**\n * @param ui - image tool Ui module\n * @param ui.api - Editor.js API\n * @param ui.config - user config\n * @param ui.onSelectFile - callback for clicks on Select file button\n * @param ui.readOnly - read-only mode flag\n */\n constructor({ api: i, config: a, onSelectFile: s, readOnly: r }) {\n this.api = i, this.config = a, this.onSelectFile = s, this.readOnly = r, this.nodes = {\n wrapper: M(\"div\", [this.CSS.baseClass, this.CSS.wrapper]),\n imageContainer: M(\"div\", [this.CSS.imageContainer]),\n fileButton: this.createFileButton(),\n imageEl: void 0,\n imagePreloader: M(\"div\", this.CSS.imagePreloader),\n caption: M(\"div\", [this.CSS.input, this.CSS.caption], {\n contentEditable: !this.readOnly\n })\n }, this.nodes.caption.dataset.placeholder = this.config.captionPlaceholder, this.nodes.imageContainer.appendChild(this.nodes.imagePreloader), this.nodes.wrapper.appendChild(this.nodes.imageContainer), this.nodes.wrapper.appendChild(this.nodes.caption), this.nodes.wrapper.appendChild(this.nodes.fileButton);\n }\n /**\n * Apply visual representation of activated tune\n * @param tuneName - one of available tunes {@link Tunes.tunes}\n * @param status - true for enable, false for disable\n */\n applyTune(i, a) {\n this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${i}`, a);\n }\n /**\n * Renders tool UI\n * @param toolData - saved tool data\n */\n render(i) {\n return i.file === void 0 || Object.keys(i.file).length === 0 ? this.toggleStatus(\n \"empty\"\n /* Empty */\n ) : this.toggleStatus(\n \"uploading\"\n /* Uploading */\n ), this.nodes.wrapper;\n }\n /**\n * Shows uploading preloader\n * @param src - preview source\n */\n showPreloader(i) {\n this.nodes.imagePreloader.style.backgroundImage = `url(${i})`, this.toggleStatus(\n \"uploading\"\n /* Uploading */\n );\n }\n /**\n * Hide uploading preloader\n */\n hidePreloader() {\n this.nodes.imagePreloader.style.backgroundImage = \"\", this.toggleStatus(\n \"empty\"\n /* Empty */\n );\n }\n /**\n * Shows an image\n * @param url - image source\n */\n fillImage(i) {\n const a = /\\.mp4$/.test(i) ? \"VIDEO\" : \"IMG\", s = {\n src: i\n };\n let r = \"load\";\n a === \"VIDEO\" && (s.autoplay = !0, s.loop = !0, s.muted = !0, s.playsinline = !0, r = \"loadeddata\"), this.nodes.imageEl = M(a, this.CSS.imageEl, s), this.nodes.imageEl.addEventListener(r, () => {\n this.toggleStatus(\n \"filled\"\n /* Filled */\n ), this.nodes.imagePreloader !== void 0 && (this.nodes.imagePreloader.style.backgroundImage = \"\");\n }), this.nodes.imageContainer.appendChild(this.nodes.imageEl);\n }\n /**\n * Shows caption input\n * @param text - caption content text\n */\n fillCaption(i) {\n this.nodes.caption !== void 0 && (this.nodes.caption.innerHTML = i);\n }\n /**\n * CSS classes\n */\n get CSS() {\n return {\n baseClass: this.api.styles.block,\n loading: this.api.styles.loader,\n input: this.api.styles.input,\n button: this.api.styles.button,\n /**\n * Tool's classes\n */\n wrapper: \"image-tool\",\n imageContainer: \"image-tool__image\",\n imagePreloader: \"image-tool__image-preloader\",\n imageEl: \"image-tool__image-picture\",\n caption: \"image-tool__caption\"\n };\n }\n /**\n * Creates upload-file button\n */\n createFileButton() {\n const i = M(\"div\", [this.CSS.button]);\n return i.innerHTML = this.config.buttonContent ?? `${L} ${this.api.i18n.t(\"Select an Image\")}`, i.addEventListener(\"click\", () => {\n this.onSelectFile();\n }), i;\n }\n /**\n * Changes UI status\n * @param status - see {@link Ui.status} constants\n */\n toggleStatus(i) {\n for (const a in S)\n Object.prototype.hasOwnProperty.call(S, a) && this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${S[a]}`, i === S[a]);\n }\n}\nfunction D(C) {\n return C && C.__esModule && Object.prototype.hasOwnProperty.call(C, \"default\") ? C.default : C;\n}\nvar H = { exports: {} };\n(function(C, i) {\n (function(a, s) {\n C.exports = s();\n })(window, function() {\n return function(a) {\n var s = {};\n function r(e) {\n if (s[e]) return s[e].exports;\n var o = s[e] = { i: e, l: !1, exports: {} };\n return a[e].call(o.exports, o, o.exports, r), o.l = !0, o.exports;\n }\n return r.m = a, r.c = s, r.d = function(e, o, d) {\n r.o(e, o) || Object.defineProperty(e, o, { enumerable: !0, get: d });\n }, r.r = function(e) {\n typeof Symbol < \"u\" && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: \"Module\" }), Object.defineProperty(e, \"__esModule\", { value: !0 });\n }, r.t = function(e, o) {\n if (1 & o && (e = r(e)), 8 & o || 4 & o && typeof e == \"object\" && e && e.__esModule) return e;\n var d = /* @__PURE__ */ Object.create(null);\n if (r.r(d), Object.defineProperty(d, \"default\", { enumerable: !0, value: e }), 2 & o && typeof e != \"string\") for (var v in e) r.d(d, v, (function(l) {\n return e[l];\n }).bind(null, v));\n return d;\n }, r.n = function(e) {\n var o = e && e.__esModule ? function() {\n return e.default;\n } : function() {\n return e;\n };\n return r.d(o, \"a\", o), o;\n }, r.o = function(e, o) {\n return Object.prototype.hasOwnProperty.call(e, o);\n }, r.p = \"\", r(r.s = 3);\n }([function(a, s) {\n var r;\n r = /* @__PURE__ */ function() {\n return this;\n }();\n try {\n r = r || new Function(\"return this\")();\n } catch {\n typeof window == \"object\" && (r = window);\n }\n a.exports = r;\n }, function(a, s, r) {\n (function(e) {\n var o = r(2), d = setTimeout;\n function v() {\n }\n function l(n) {\n if (!(this instanceof l)) throw new TypeError(\"Promises must be constructed via new\");\n if (typeof n != \"function\") throw new TypeError(\"not a function\");\n this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], t(n, this);\n }\n function f(n, c) {\n for (; n._state === 3; ) n = n._value;\n n._state !== 0 ? (n._handled = !0, l._immediateFn(function() {\n var u = n._state === 1 ? c.onFulfilled : c.onRejected;\n if (u !== null) {\n var g;\n try {\n g = u(n._value);\n } catch (m) {\n return void y(c.promise, m);\n }\n p(c.promise, g);\n } else (n._state === 1 ? p : y)(c.promise, n._value);\n })) : n._deferreds.push(c);\n }\n function p(n, c) {\n try {\n if (c === n) throw new TypeError(\"A promise cannot be resolved with itself.\");\n if (c && (typeof c == \"object\" || typeof c == \"function\")) {\n var u = c.then;\n if (c instanceof l) return n._state = 3, n._value = c, void w(n);\n if (typeof u == \"function\") return void t((g = u, m = c, function() {\n g.apply(m, arguments);\n }), n);\n }\n n._state = 1, n._value = c, w(n);\n } catch (h) {\n y(n, h);\n }\n var g, m;\n }\n function y(n, c) {\n n._state = 2, n._value = c, w(n);\n }\n function w(n) {\n n._state === 2 && n._deferreds.length === 0 && l._immediateFn(function() {\n n._handled || l._unhandledRejectionFn(n._value);\n });\n for (var c = 0, u = n._deferreds.length; c < u; c++) f(n, n._deferreds[c]);\n n._deferreds = null;\n }\n function b(n, c, u) {\n this.onFulfilled = typeof n == \"function\" ? n : null, this.onRejected = typeof c == \"function\" ? c : null, this.promise = u;\n }\n function t(n, c) {\n var u = !1;\n try {\n n(function(g) {\n u || (u = !0, p(c, g));\n }, function(g) {\n u || (u = !0, y(c, g));\n });\n } catch (g) {\n if (u) return;\n u = !0, y(c, g);\n }\n }\n l.prototype.catch = function(n) {\n return this.then(null, n);\n }, l.prototype.then = function(n, c) {\n var u = new this.constructor(v);\n return f(this, new b(n, c, u)), u;\n }, l.prototype.finally = o.a, l.all = function(n) {\n return new l(function(c, u) {\n if (!n || n.length === void 0) throw new TypeError(\"Promise.all accepts an array\");\n var g = Array.prototype.slice.call(n);\n if (g.length === 0) return c([]);\n var m = g.length;\n function h(T, E) {\n try {\n if (E && (typeof E == \"object\" || typeof E == \"function\")) {\n var j = E.then;\n if (typeof j == \"function\") return void j.call(E, function(F) {\n h(T, F);\n }, u);\n }\n g[T] = E, --m == 0 && c(g);\n } catch (F) {\n u(F);\n }\n }\n for (var k = 0; k < g.length; k++) h(k, g[k]);\n });\n }, l.resolve = function(n) {\n return n && typeof n == \"object\" && n.constructor === l ? n : new l(function(c) {\n c(n);\n });\n }, l.reject = function(n) {\n return new l(function(c, u) {\n u(n);\n });\n }, l.race = function(n) {\n return new l(function(c, u) {\n for (var g = 0, m = n.length; g < m; g++) n[g].then(c, u);\n });\n }, l._immediateFn = typeof e == \"function\" && function(n) {\n e(n);\n } || function(n) {\n d(n, 0);\n }, l._unhandledRejectionFn = function(n) {\n typeof console < \"u\" && console && console.warn(\"Possible Unhandled Promise Rejection:\", n);\n }, s.a = l;\n }).call(this, r(5).setImmediate);\n }, function(a, s, r) {\n s.a = function(e) {\n var o = this.constructor;\n return this.then(function(d) {\n return o.resolve(e()).then(function() {\n return d;\n });\n }, function(d) {\n return o.resolve(e()).then(function() {\n return o.reject(d);\n });\n });\n };\n }, function(a, s, r) {\n function e(t) {\n return (e = typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" ? function(n) {\n return typeof n;\n } : function(n) {\n return n && typeof Symbol == \"function\" && n.constructor === Symbol && n !== Symbol.prototype ? \"symbol\" : typeof n;\n })(t);\n }\n r(4);\n var o, d, v, l, f, p, y, w = r(8), b = (d = function(t) {\n return new Promise(function(n, c) {\n t = l(t), (t = f(t)).beforeSend && t.beforeSend();\n var u = window.XMLHttpRequest ? new window.XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n u.open(t.method, t.url), u.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\"), Object.keys(t.headers).forEach(function(m) {\n var h = t.headers[m];\n u.setRequestHeader(m, h);\n });\n var g = t.ratio;\n u.upload.addEventListener(\"progress\", function(m) {\n var h = Math.round(m.loaded / m.total * 100), k = Math.ceil(h * g / 100);\n t.progress(Math.min(k, 100));\n }, !1), u.addEventListener(\"progress\", function(m) {\n var h = Math.round(m.loaded / m.total * 100), k = Math.ceil(h * (100 - g) / 100) + g;\n t.progress(Math.min(k, 100));\n }, !1), u.onreadystatechange = function() {\n if (u.readyState === 4) {\n var m = u.response;\n try {\n m = JSON.parse(m);\n } catch {\n }\n var h = w.parseHeaders(u.getAllResponseHeaders()), k = { body: m, code: u.status, headers: h };\n y(u.status) ? n(k) : c(k);\n }\n }, u.send(t.data);\n });\n }, v = function(t) {\n return t.method = \"POST\", d(t);\n }, l = function() {\n var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n if (t.url && typeof t.url != \"string\") throw new Error(\"Url must be a string\");\n if (t.url = t.url || \"\", t.method && typeof t.method != \"string\") throw new Error(\"`method` must be a string or null\");\n if (t.method = t.method ? t.method.toUpperCase() : \"GET\", t.headers && e(t.headers) !== \"object\") throw new Error(\"`headers` must be an object or null\");\n if (t.headers = t.headers || {}, t.type && (typeof t.type != \"string\" || !Object.values(o).includes(t.type))) throw new Error(\"`type` must be taken from module's \u00ABcontentType\u00BB library\");\n if (t.progress && typeof t.progress != \"function\") throw new Error(\"`progress` must be a function or null\");\n if (t.progress = t.progress || function(n) {\n }, t.beforeSend = t.beforeSend || function(n) {\n }, t.ratio && typeof t.ratio != \"number\") throw new Error(\"`ratio` must be a number\");\n if (t.ratio < 0 || t.ratio > 100) throw new Error(\"`ratio` must be in a 0-100 interval\");\n if (t.ratio = t.ratio || 90, t.accept && typeof t.accept != \"string\") throw new Error(\"`accept` must be a string with a list of allowed mime-types\");\n if (t.accept = t.accept || \"*/*\", t.multiple && typeof t.multiple != \"boolean\") throw new Error(\"`multiple` must be a true or false\");\n if (t.multiple = t.multiple || !1, t.fieldName && typeof t.fieldName != \"string\") throw new Error(\"`fieldName` must be a string\");\n return t.fieldName = t.fieldName || \"files\", t;\n }, f = function(t) {\n switch (t.method) {\n case \"GET\":\n var n = p(t.data, o.URLENCODED);\n delete t.data, t.url = /\\?/.test(t.url) ? t.url + \"&\" + n : t.url + \"?\" + n;\n break;\n case \"POST\":\n case \"PUT\":\n case \"DELETE\":\n case \"UPDATE\":\n var c = function() {\n return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}).type || o.JSON;\n }(t);\n (w.isFormData(t.data) || w.isFormElement(t.data)) && (c = o.FORM), t.data = p(t.data, c), c !== b.contentType.FORM && (t.headers[\"content-type\"] = c);\n }\n return t;\n }, p = function() {\n var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n switch (arguments.length > 1 ? arguments[1] : void 0) {\n case o.URLENCODED:\n return w.urlEncode(t);\n case o.JSON:\n return w.jsonEncode(t);\n case o.FORM:\n return w.formEncode(t);\n default:\n return t;\n }\n }, y = function(t) {\n return t >= 200 && t < 300;\n }, { contentType: o = { URLENCODED: \"application/x-www-form-urlencoded; charset=utf-8\", FORM: \"multipart/form-data\", JSON: \"application/json; charset=utf-8\" }, request: d, get: function(t) {\n return t.method = \"GET\", d(t);\n }, post: v, transport: function(t) {\n return t = l(t), w.selectFiles(t).then(function(n) {\n for (var c = new FormData(), u = 0; u < n.length; u++) c.append(t.fieldName, n[u], n[u].name);\n w.isObject(t.data) && Object.keys(t.data).forEach(function(m) {\n var h = t.data[m];\n c.append(m, h);\n });\n var g = t.beforeSend;\n return t.beforeSend = function() {\n return g(n);\n }, t.data = c, v(t);\n });\n }, selectFiles: function(t) {\n return delete (t = l(t)).beforeSend, w.selectFiles(t);\n } });\n a.exports = b;\n }, function(a, s, r) {\n r.r(s);\n var e = r(1);\n window.Promise = window.Promise || e.a;\n }, function(a, s, r) {\n (function(e) {\n var o = e !== void 0 && e || typeof self < \"u\" && self || window, d = Function.prototype.apply;\n function v(l, f) {\n this._id = l, this._clearFn = f;\n }\n s.setTimeout = function() {\n return new v(d.call(setTimeout, o, arguments), clearTimeout);\n }, s.setInterval = function() {\n return new v(d.call(setInterval, o, arguments), clearInterval);\n }, s.clearTimeout = s.clearInterval = function(l) {\n l && l.close();\n }, v.prototype.unref = v.prototype.ref = function() {\n }, v.prototype.close = function() {\n this._clearFn.call(o, this._id);\n }, s.enroll = function(l, f) {\n clearTimeout(l._idleTimeoutId), l._idleTimeout = f;\n }, s.unenroll = function(l) {\n clearTimeout(l._idleTimeoutId), l._idleTimeout = -1;\n }, s._unrefActive = s.active = function(l) {\n clearTimeout(l._idleTimeoutId);\n var f = l._idleTimeout;\n f >= 0 && (l._idleTimeoutId = setTimeout(function() {\n l._onTimeout && l._onTimeout();\n }, f));\n }, r(6), s.setImmediate = typeof self < \"u\" && self.setImmediate || e !== void 0 && e.setImmediate || this && this.setImmediate, s.clearImmediate = typeof self < \"u\" && self.clearImmediate || e !== void 0 && e.clearImmediate || this && this.clearImmediate;\n }).call(this, r(0));\n }, function(a, s, r) {\n (function(e, o) {\n (function(d, v) {\n if (!d.setImmediate) {\n var l, f, p, y, w, b = 1, t = {}, n = !1, c = d.document, u = Object.getPrototypeOf && Object.getPrototypeOf(d);\n u = u && u.setTimeout ? u : d, {}.toString.call(d.process) === \"[object process]\" ? l = function(h) {\n o.nextTick(function() {\n m(h);\n });\n } : function() {\n if (d.postMessage && !d.importScripts) {\n var h = !0, k = d.onmessage;\n return d.onmessage = function() {\n h = !1;\n }, d.postMessage(\"\", \"*\"), d.onmessage = k, h;\n }\n }() ? (y = \"setImmediate$\" + Math.random() + \"$\", w = function(h) {\n h.source === d && typeof h.data == \"string\" && h.data.indexOf(y) === 0 && m(+h.data.slice(y.length));\n }, d.addEventListener ? d.addEventListener(\"message\", w, !1) : d.attachEvent(\"onmessage\", w), l = function(h) {\n d.postMessage(y + h, \"*\");\n }) : d.MessageChannel ? ((p = new MessageChannel()).port1.onmessage = function(h) {\n m(h.data);\n }, l = function(h) {\n p.port2.postMessage(h);\n }) : c && \"onreadystatechange\" in c.createElement(\"script\") ? (f = c.documentElement, l = function(h) {\n var k = c.createElement(\"script\");\n k.onreadystatechange = function() {\n m(h), k.onreadystatechange = null, f.removeChild(k), k = null;\n }, f.appendChild(k);\n }) : l = function(h) {\n setTimeout(m, 0, h);\n }, u.setImmediate = function(h) {\n typeof h != \"function\" && (h = new Function(\"\" + h));\n for (var k = new Array(arguments.length - 1), T = 0; T < k.length; T++) k[T] = arguments[T + 1];\n var E = { callback: h, args: k };\n return t[b] = E, l(b), b++;\n }, u.clearImmediate = g;\n }\n function g(h) {\n delete t[h];\n }\n function m(h) {\n if (n) setTimeout(m, 0, h);\n else {\n var k = t[h];\n if (k) {\n n = !0;\n try {\n (function(T) {\n var E = T.callback, j = T.args;\n switch (j.length) {\n case 0:\n E();\n break;\n case 1:\n E(j[0]);\n break;\n case 2:\n E(j[0], j[1]);\n break;\n case 3:\n E(j[0], j[1], j[2]);\n break;\n default:\n E.apply(v, j);\n }\n })(k);\n } finally {\n g(h), n = !1;\n }\n }\n }\n }\n })(typeof self > \"u\" ? e === void 0 ? this : e : self);\n }).call(this, r(0), r(7));\n }, function(a, s) {\n var r, e, o = a.exports = {};\n function d() {\n throw new Error(\"setTimeout has not been defined\");\n }\n function v() {\n throw new Error(\"clearTimeout has not been defined\");\n }\n function l(u) {\n if (r === setTimeout) return setTimeout(u, 0);\n if ((r === d || !r) && setTimeout) return r = setTimeout, setTimeout(u, 0);\n try {\n return r(u, 0);\n } catch {\n try {\n return r.call(null, u, 0);\n } catch {\n return r.call(this, u, 0);\n }\n }\n }\n (function() {\n try {\n r = typeof setTimeout == \"function\" ? setTimeout : d;\n } catch {\n r = d;\n }\n try {\n e = typeof clearTimeout == \"function\" ? clearTimeout : v;\n } catch {\n e = v;\n }\n })();\n var f, p = [], y = !1, w = -1;\n function b() {\n y && f && (y = !1, f.length ? p = f.concat(p) : w = -1, p.length && t());\n }\n function t() {\n if (!y) {\n var u = l(b);\n y = !0;\n for (var g = p.length; g; ) {\n for (f = p, p = []; ++w < g; ) f && f[w].run();\n w = -1, g = p.length;\n }\n f = null, y = !1, function(m) {\n if (e === clearTimeout) return clearTimeout(m);\n if ((e === v || !e) && clearTimeout) return e = clearTimeout, clearTimeout(m);\n try {\n e(m);\n } catch {\n try {\n return e.call(null, m);\n } catch {\n return e.call(this, m);\n }\n }\n }(u);\n }\n }\n function n(u, g) {\n this.fun = u, this.array = g;\n }\n function c() {\n }\n o.nextTick = function(u) {\n var g = new Array(arguments.length - 1);\n if (arguments.length > 1) for (var m = 1; m < arguments.length; m++) g[m - 1] = arguments[m];\n p.push(new n(u, g)), p.length !== 1 || y || l(t);\n }, n.prototype.run = function() {\n this.fun.apply(null, this.array);\n }, o.title = \"browser\", o.browser = !0, o.env = {}, o.argv = [], o.version = \"\", o.versions = {}, o.on = c, o.addListener = c, o.once = c, o.off = c, o.removeListener = c, o.removeAllListeners = c, o.emit = c, o.prependListener = c, o.prependOnceListener = c, o.listeners = function(u) {\n return [];\n }, o.binding = function(u) {\n throw new Error(\"process.binding is not supported\");\n }, o.cwd = function() {\n return \"/\";\n }, o.chdir = function(u) {\n throw new Error(\"process.chdir is not supported\");\n }, o.umask = function() {\n return 0;\n };\n }, function(a, s, r) {\n function e(d, v) {\n for (var l = 0; l < v.length; l++) {\n var f = v[l];\n f.enumerable = f.enumerable || !1, f.configurable = !0, \"value\" in f && (f.writable = !0), Object.defineProperty(d, f.key, f);\n }\n }\n var o = r(9);\n a.exports = function() {\n function d() {\n (function(p, y) {\n if (!(p instanceof y)) throw new TypeError(\"Cannot call a class as a function\");\n })(this, d);\n }\n var v, l, f;\n return v = d, f = [{ key: \"urlEncode\", value: function(p) {\n return o(p);\n } }, { key: \"jsonEncode\", value: function(p) {\n return JSON.stringify(p);\n } }, { key: \"formEncode\", value: function(p) {\n if (this.isFormData(p)) return p;\n if (this.isFormElement(p)) return new FormData(p);\n if (this.isObject(p)) {\n var y = new FormData();\n return Object.keys(p).forEach(function(w) {\n var b = p[w];\n y.append(w, b);\n }), y;\n }\n throw new Error(\"`data` must be an instance of Object, FormData or <FORM> HTMLElement\");\n } }, { key: \"isObject\", value: function(p) {\n return Object.prototype.toString.call(p) === \"[object Object]\";\n } }, { key: \"isFormData\", value: function(p) {\n return p instanceof FormData;\n } }, { key: \"isFormElement\", value: function(p) {\n return p instanceof HTMLFormElement;\n } }, { key: \"selectFiles\", value: function() {\n var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n return new Promise(function(y, w) {\n var b = document.createElement(\"INPUT\");\n b.type = \"file\", p.multiple && b.setAttribute(\"multiple\", \"multiple\"), p.accept && b.setAttribute(\"accept\", p.accept), b.style.display = \"none\", document.body.appendChild(b), b.addEventListener(\"change\", function(t) {\n var n = t.target.files;\n y(n), document.body.removeChild(b);\n }, !1), b.click();\n });\n } }, { key: \"parseHeaders\", value: function(p) {\n var y = p.trim().split(/[\\r\\n]+/), w = {};\n return y.forEach(function(b) {\n var t = b.split(\": \"), n = t.shift(), c = t.join(\": \");\n n && (w[n] = c);\n }), w;\n } }], (l = null) && e(v.prototype, l), f && e(v, f), d;\n }();\n }, function(a, s) {\n var r = function(o) {\n return encodeURIComponent(o).replace(/[!'()*]/g, escape).replace(/%20/g, \"+\");\n }, e = function(o, d, v, l) {\n return d = d || null, v = v || \"&\", l = l || null, o ? function(f) {\n for (var p = new Array(), y = 0; y < f.length; y++) f[y] && p.push(f[y]);\n return p;\n }(Object.keys(o).map(function(f) {\n var p, y, w = f;\n if (l && (w = l + \"[\" + w + \"]\"), typeof o[f] == \"object\" && o[f] !== null) p = e(o[f], null, v, w);\n else {\n d && (y = w, w = !isNaN(parseFloat(y)) && isFinite(y) ? d + Number(w) : w);\n var b = o[f];\n b = (b = (b = (b = b === !0 ? \"1\" : b) === !1 ? \"0\" : b) === 0 ? \"0\" : b) || \"\", p = r(w) + \"=\" + r(b);\n }\n return p;\n })).join(v).replace(/[!'()*]/g, \"\") : \"\";\n };\n a.exports = e;\n }]);\n });\n})(H);\nvar q = H.exports;\nconst _ = /* @__PURE__ */ D(q);\nfunction O(C) {\n return C !== void 0 && typeof C.then == \"function\";\n}\nclass A {\n /**\n * @param params - uploader module params\n * @param params.config - image tool config\n * @param params.onUpload - one callback for all uploading (file, url, d-n-d, pasting)\n * @param params.onError - callback for uploading errors\n */\n constructor({ config: i, onUpload: a, onError: s }) {\n this.config = i, this.onUpload = a, this.onError = s;\n }\n /**\n * Handle clicks on the upload file button\n * Fires ajax.transport()\n * @param onPreview - callback fired when preview is ready\n */\n uploadSelectedFile({ onPreview: i }) {\n const a = function(r) {\n const e = new FileReader();\n e.readAsDataURL(r), e.onload = (o) => {\n i(o.target.result);\n };\n };\n let s;\n if (this.config.uploader && typeof this.config.uploader.uploadByFile == \"function\") {\n const r = this.config.uploader.uploadByFile;\n s = _.selectFiles({ accept: this.config.types ?? \"image/*\" }).then((e) => {\n a(e[0]);\n const o = r(e[0]);\n return O(o) || console.warn(\"Custom uploader method uploadByFile should return a Promise\"), o;\n });\n } else\n s = _.transport({\n url: this.config.endpoints.byFile,\n data: this.config.additionalRequestData,\n accept: this.config.types ?? \"image/*\",\n headers: this.config.additionalRequestHeaders,\n beforeSend: (r) => {\n a(r[0]);\n },\n fieldName: this.config.field ?? \"image\"\n }).then((r) => r.body);\n s.then((r) => {\n this.onUpload(r);\n }).catch((r) => {\n this.onError(r);\n });\n }\n /**\n * Handle clicks on the upload file button\n * Fires ajax.post()\n * @param url - image source url\n */\n uploadByUrl(i) {\n let a;\n this.config.uploader && typeof this.config.uploader.uploadByUrl == \"function\" ? (a = this.config.uploader.uploadByUrl(i), O(a) || console.warn(\"Custom uploader method uploadByUrl should return a Promise\")) : a = _.post({\n url: this.config.endpoints.byUrl,\n data: Object.assign({\n url: i\n }, this.config.additionalRequestData),\n type: _.contentType.JSON,\n headers: this.config.additionalRequestHeaders\n }).then((s) => s.body), a.then((s) => {\n this.onUpload(s);\n }).catch((s) => {\n this.onError(s);\n });\n }\n /**\n * Handle clicks on the upload file button\n * Fires ajax.post()\n * @param file - file pasted by drag-n-drop\n * @param onPreview - file pasted by drag-n-drop\n */\n uploadByFile(i, { onPreview: a }) {\n const s = new FileReader();\n s.readAsDataURL(i), s.onload = (e) => {\n a(e.target.result);\n };\n let r;\n if (this.config.uploader && typeof this.config.uploader.uploadByFile == \"function\")\n r = this.config.uploader.uploadByFile(i), O(r) || console.warn(\"Custom uploader method uploadByFile should return a Promise\");\n else {\n const e = new FormData();\n e.append(this.config.field ?? \"image\", i), this.config.additionalRequestData && Object.keys(this.config.additionalRequestData).length && Object.entries(this.config.additionalRequestData).forEach(([o, d]) => {\n e.append(o, d);\n }), r = _.post({\n url: this.config.endpoints.byFile,\n data: e,\n type: _.contentType.JSON,\n headers: this.config.additionalRequestHeaders\n }).then((o) => o.body);\n }\n r.then((e) => {\n this.onUpload(e);\n }).catch((e) => {\n this.onError(e);\n });\n }\n}\n/**\n * Image Tool for the Editor.js\n * @author CodeX <team@codex.so>\n * @license MIT\n * @see {@link https://github.com/editor-js/image}\n *\n * To developers.\n * To simplify Tool structure, we split it to 4 parts:\n * 1) index.ts \u2014 main Tool's interface, public API and methods for working with data\n * 2) uploader.ts \u2014 module that has methods for sending files via AJAX: from device, by URL or File pasting\n * 3) ui.ts \u2014 module for UI manipulations: render, showing preloader, etc\n *\n * For debug purposes there is a testing server\n * that can save uploaded files and return a Response {@link UploadResponseFormat}\n *\n * $ node dev/server.js\n *\n * It will expose 8008 port, so you can pass http://localhost:8008 with the Tools config:\n *\n * image: {\n * class: ImageTool,\n * config: {\n * endpoints: {\n * byFile: 'http://localhost:8008/uploadFile',\n * byUrl: 'http://localhost:8008/fetchUrl',\n * }\n * },\n * },\n */\nclass P {\n /**\n * @param tool - tool properties got from editor.js\n * @param tool.data - previously saved data\n * @param tool.config - user config for Tool\n * @param tool.api - Editor.js API\n * @param tool.readOnly - read-only mode flag\n * @param tool.block - current Block API\n */\n constructor({ data: i, config: a, api: s, readOnly: r, block: e }) {\n this.api = s, this.block = e, this.config = {\n endpoints: a.endpoints,\n additionalRequestData: a.additionalRequestData,\n additionalRequestHeaders: a.additionalRequestHeaders,\n field: a.field,\n types: a.types,\n captionPlaceholder: this.api.i18n.t(a.captionPlaceholder ?? \"Caption\"),\n buttonContent: a.buttonContent,\n uploader: a.uploader,\n actions: a.actions,\n features: a.features || {}\n }, this.uploader = new A({\n config: this.config,\n onUpload: (o) => this.onUpload(o),\n onError: (o) => this.uploadingFailed(o)\n }), this.ui = new U({\n api: s,\n config: this.config,\n onSelectFile: () => {\n this.uploader.uploadSelectedFile({\n onPreview: (o) => {\n this.ui.showPreloader(o);\n }\n });\n },\n readOnly: r\n }), this._data = {\n caption: \"\",\n withBorder: !1,\n withBackground: !1,\n stretched: !1,\n file: {\n url: \"\"\n }\n }, this.data = i;\n }\n /**\n * Notify core that read-only mode is supported\n */\n static get isReadOnlySupported() {\n return !0;\n }\n /**\n * Get Tool toolbox settings\n * icon - Tool icon's SVG\n * title - title to show in toolbox\n */\n static get toolbox() {\n return {\n icon: L,\n title: \"Image\"\n };\n }\n /**\n * Available image tools\n */\n static get tunes() {\n return [\n {\n name: \"withBorder\",\n icon: I,\n title: \"With border\",\n toggle: !0\n },\n {\n name: \"stretched\",\n icon: x,\n title: \"Stretch image\",\n toggle: !0\n },\n {\n name: \"withBackground\",\n icon: R,\n title: \"With background\",\n toggle: !0\n }\n ];\n }\n /**\n * Renders Block content\n */\n render() {\n var i, a, s;\n return (((i = this.config.features) == null ? void 0 : i.caption) === !0 || ((a = this.config.features) == null ? void 0 : a.caption) === void 0 || ((s = this.config.features) == null ? void 0 : s.caption) === \"optional\" && this.data.caption) && this.ui.applyTune(\"caption\", !0), this.ui.render(this.data);\n }\n /**\n * Validate data: check if Image exists\n * @param savedData \u2014 data received after saving\n * @returns false if saved data is not correct, otherwise true\n */\n validate(i) {\n return !!i.file.url;\n }\n /**\n * Return Block data\n */\n save() {\n const i = this.ui.nodes.caption;\n return this._data.caption = i.innerHTML, this.data;\n }\n /**\n * Returns configuration for block tunes: add background, add border, stretch image\n * @returns TunesMenuConfig\n */\n renderSettings() {\n var r;\n const i = P.tunes.concat(this.config.actions || []), a = {\n border: \"withBorder\",\n background: \"withBackground\",\n stretch: \"stretched\",\n caption: \"caption\"\n };\n return ((r = this.config.features) == null ? void 0 : r.caption) === \"optional\" && i.push({\n name: \"caption\",\n icon: B,\n title: \"With caption\",\n toggle: !0\n }), i.filter((e) => {\n var d, v;\n const o = Object.keys(a).find((l) => a[l] === e.name);\n return o === \"caption\" ? ((d = this.config.features) == null ? void 0 : d.caption) !== !1 : o == null || ((v = this.config.features) == null ? void 0 : v[o]) !== !1;\n }).map((e) => ({\n icon: e.icon,\n label: this.api.i18n.t(e.title),\n name: e.name,\n toggle: e.toggle,\n isActive: this.data[e.name],\n onActivate: () => {\n if (typeof e.action == \"function\") {\n e.action(e.name);\n return;\n }\n this.tuneToggled(e.name);\n }\n }));\n }\n /**\n * Fires after clicks on the Toolbox Image Icon\n * Initiates click on the Select File button\n */\n appendCallback() {\n this.ui.nodes.fileButton.click();\n }\n /**\n * Specify paste substitutes\n * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling}\n */\n static get pasteConfig() {\n return {\n /**\n * Paste HTML into Editor\n */\n tags: [\n {\n img: { src: !0 }\n }\n ],\n /**\n * Paste URL of image into the Editor\n */\n patterns: {\n image: /https?:\\/\\/\\S+\\.(gif|jpe?g|tiff|png|svg|webp)(\\?[a-z0-9=]*)?$/i\n },\n /**\n * Drag n drop file from into the Editor\n */\n files: {\n mimeTypes: [\"image/*\"]\n }\n };\n }\n /**\n * Specify paste handlers\n * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling}\n * @param event - editor.js custom paste event\n * {@link https://github.com/codex-team/editor.js/blob/master/types/tools/paste-events.d.ts}\n */\n async onPaste(i) {\n switch (i.type) {\n case \"tag\": {\n const a = i.detail.data;\n if (/^blob:/.test(a.src)) {\n const r = await (await fetch(a.src)).blob();\n this.uploadFile(r);\n break;\n }\n this.uploadUrl(a.src);\n break;\n }\n case \"pattern\": {\n const a = i.detail.data;\n this.uploadUrl(a);\n break;\n }\n case \"file\": {\n const a = i.detail.file;\n this.uploadFile(a);\n break;\n }\n }\n }\n /**\n * Private methods\n * \u033F\u033F \u033F\u033F \u033F\u033F \u033F'\u033F'\\\u0335\u0347\u033F\u033F\\\u0437= ( \u2580 \u035C\u035E\u0296\u2580) =\u03B5/\u0335\u0347\u033F\u033F/\u2019\u033F\u2019\u033F \u033F \u033F\u033F \u033F\u033F \u033F\u033F\n */\n /**\n * Stores all Tool's data\n * @param data - data in Image Tool format\n */\n set data(i) {\n this.image = i.file, this._data.caption = i.caption || \"\", this.ui.fillCaption(this._data.caption), P.tunes.forEach(({ name: a }) => {\n const s = typeof i[a] < \"u\" ? i[a] === !0 || i[a] === \"true\" : !1;\n this.setTune(a, s);\n });\n }\n /**\n * Return Tool data\n */\n get data() {\n return this._data;\n }\n /**\n * Set new image file\n * @param file - uploaded file data\n */\n set image(i) {\n this._data.file = i || { url: \"\" }, i && i.url && this.ui.fillImage(i.url);\n }\n /**\n * File uploading callback\n * @param response - uploading server response\n */\n onUpload(i) {\n i.success && i.file ? this.image = i.file : this.uploadingFailed(\"incorrect response: \" + JSON.stringify(i));\n }\n /**\n * Handle uploader errors\n * @param errorText - uploading error info\n */\n uploadingFailed(i) {\n console.log(\"Image Tool: uploading failed because of\", i), this.api.notifier.show({\n message: this.api.i18n.t(\"Couldn\u2019t upload image. Please try another.\"),\n style: \"error\"\n }), this.ui.hidePreloader();\n }\n /**\n * Callback fired when Block Tune is activated\n * @param tuneName - tune that has been clicked\n */\n tuneToggled(i) {\n this.setTune(i, !this._data[i]), i === \"caption\" && !this._data[i] && (this._data.caption = \"\", this.ui.fillCaption(\"\"));\n }\n /**\n * Set one tune\n * @param tuneName - {@link Tunes.tunes}\n * @param value - tune state\n */\n setTune(i, a) {\n this._data[i] = a, this.ui.applyTune(i, a), i === \"stretched\" && Promise.resolve().then(() => {\n this.block.stretched = a;\n }).catch((s) => {\n console.error(s);\n });\n }\n /**\n * Show preloader and upload image file\n * @param file - file that is currently uploading (from paste)\n */\n uploadFile(i) {\n this.uploader.uploadByFile(i, {\n onPreview: (a) => {\n this.ui.showPreloader(a);\n }\n });\n }\n /**\n * Show preloader and upload image by target url\n * @param url - url pasted\n */\n uploadUrl(i) {\n this.ui.showPreloader(i), this.uploader.uploadByUrl(i);\n }\n}\nexport {\n P as default\n};\n", "(function(){\"use strict\";try{if(typeof document<\"u\"){var e=document.createElement(\"style\");e.appendChild(document.createTextNode('.embed-tool--loading .embed-tool__caption{display:none}.embed-tool--loading .embed-tool__preloader{display:block}.embed-tool--loading .embed-tool__content{display:none}.embed-tool__preloader{display:none;position:relative;height:200px;box-sizing:border-box;border-radius:5px;border:1px solid #e6e9eb}.embed-tool__preloader:before{content:\"\";position:absolute;z-index:3;left:50%;top:50%;width:30px;height:30px;margin-top:-25px;margin-left:-15px;border-radius:50%;border:2px solid #cdd1e0;border-top-color:#388ae5;box-sizing:border-box;animation:embed-preloader-spin 2s infinite linear}.embed-tool__url{position:absolute;bottom:20px;left:50%;transform:translate(-50%);max-width:250px;color:#7b7e89;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.embed-tool__content{width:100%}.embed-tool__caption{margin-top:7px}.embed-tool__caption[contentEditable=true][data-placeholder]:before{position:absolute;content:attr(data-placeholder);color:#707684;font-weight:400;opacity:0}.embed-tool__caption[contentEditable=true][data-placeholder]:empty:before{opacity:1}.embed-tool__caption[contentEditable=true][data-placeholder]:empty:focus:before{opacity:0}@keyframes embed-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}')),document.head.appendChild(e)}}catch(o){console.error(\"vite-plugin-css-injected-by-js\",o)}})();\nconst g = {\n vimeo: {\n regex: /(?:http[s]?:\\/\\/)?(?:www.)?(?:player.)?vimeo\\.co(?:.+\\/([^\\/]\\d+)(?:#t=[\\d]+)?s?$)/,\n embedUrl: \"https://player.vimeo.com/video/<%= remote_id %>?title=0&byline=0\",\n html: '<iframe style=\"width:100%;\" height=\"320\" frameborder=\"0\"></iframe>',\n height: 320,\n width: 580\n },\n youtube: {\n regex: /(?:https?:\\/\\/)?(?:www\\.)?(?:(?:youtu\\.be\\/)|(?:youtube\\.com)\\/(?:v\\/|u\\/\\w\\/|embed\\/|watch))(?:(?:\\?v=)?([^#&?=]*))?((?:[?&]\\w*=\\w*)*)/,\n embedUrl: \"https://www.youtube.com/embed/<%= remote_id %>\",\n html: '<iframe style=\"width:100%;\" height=\"320\" frameborder=\"0\" allowfullscreen></iframe>',\n height: 320,\n width: 580,\n id: ([s, i]) => {\n if (!i && s)\n return s;\n const r = {\n start: \"start\",\n end: \"end\",\n t: \"start\",\n // eslint-disable-next-line camelcase\n time_continue: \"start\",\n list: \"list\"\n };\n let e = i.slice(1).split(\"&\").map((o) => {\n const [l, t] = o.split(\"=\");\n return !s && l === \"v\" ? (s = t, null) : !r[l] || t === \"LL\" || t.startsWith(\"RDMM\") || t.startsWith(\"FL\") ? null : `${r[l]}=${t}`;\n }).filter((o) => !!o);\n return s + \"?\" + e.join(\"&\");\n }\n },\n coub: {\n regex: /https?:\\/\\/coub\\.com\\/view\\/([^\\/\\?\\&]+)/,\n embedUrl: \"https://coub.com/embed/<%= remote_id %>\",\n html: '<iframe style=\"width:100%;\" height=\"320\" frameborder=\"0\" allowfullscreen></iframe>',\n height: 320,\n width: 580\n },\n vine: {\n regex: /https?:\\/\\/vine\\.co\\/v\\/([^\\/\\?\\&]+)/,\n embedUrl: \"https://vine.co/v/<%= remote_id %>/embed/simple/\",\n html: '<iframe style=\"width:100%;\" height=\"320\" frameborder=\"0\" allowfullscreen></iframe>',\n height: 320,\n width: 580\n },\n imgur: {\n regex: /https?:\\/\\/(?:i\\.)?imgur\\.com.*\\/([a-zA-Z0-9]+)(?:\\.gifv)?/,\n embedUrl: \"http://imgur.com/<%= remote_id %>/embed\",\n html: '<iframe allowfullscreen=\"true\" scrolling=\"no\" id=\"imgur-embed-iframe-pub-<%= remote_id %>\" class=\"imgur-embed-iframe-pub\" style=\"height: 500px; width: 100%; border: 1px solid #000\"></iframe>',\n height: 500,\n width: 540\n },\n gfycat: {\n regex: /https?:\\/\\/gfycat\\.com(?:\\/detail)?\\/([a-zA-Z]+)/,\n embedUrl: \"https://gfycat.com/ifr/<%= remote_id %>\",\n html: `<iframe frameborder='0' scrolling='no' style=\"width:100%;\" height='436' allowfullscreen ></iframe>`,\n height: 436,\n width: 580\n },\n \"twitch-channel\": {\n regex: /https?:\\/\\/www\\.twitch\\.tv\\/([^\\/\\?\\&]*)\\/?$/,\n embedUrl: \"https://player.twitch.tv/?channel=<%= remote_id %>\",\n html: '<iframe frameborder=\"0\" allowfullscreen=\"true\" scrolling=\"no\" height=\"366\" style=\"width:100%;\"></iframe>',\n height: 366,\n width: 600\n },\n \"twitch-video\": {\n regex: /https?:\\/\\/www\\.twitch\\.tv\\/(?:[^\\/\\?\\&]*\\/v|videos)\\/([0-9]*)/,\n embedUrl: \"https://player.twitch.tv/?video=v<%= remote_id %>\",\n html: '<iframe frameborder=\"0\" allowfullscreen=\"true\" scrolling=\"no\" height=\"366\" style=\"width:100%;\"></iframe>',\n height: 366,\n width: 600\n },\n \"yandex-music-album\": {\n regex: /https?:\\/\\/music\\.yandex\\.ru\\/album\\/([0-9]*)\\/?$/,\n embedUrl: \"https://music.yandex.ru/iframe/#album/<%= remote_id %>/\",\n html: '<iframe frameborder=\"0\" style=\"border:none;width:540px;height:400px;\" style=\"width:100%;\" height=\"400\"></iframe>',\n height: 400,\n width: 540\n },\n \"yandex-music-track\": {\n regex: /https?:\\/\\/music\\.yandex\\.ru\\/album\\/([0-9]*)\\/track\\/([0-9]*)/,\n embedUrl: \"https://music.yandex.ru/iframe/#track/<%= remote_id %>/\",\n html: '<iframe frameborder=\"0\" style=\"border:none;width:540px;height:100px;\" style=\"width:100%;\" height=\"100\"></iframe>',\n height: 100,\n width: 540,\n id: (s) => s.join(\"/\")\n },\n \"yandex-music-playlist\": {\n regex: /https?:\\/\\/music\\.yandex\\.ru\\/users\\/([^\\/\\?\\&]*)\\/playlists\\/([0-9]*)/,\n embedUrl: \"https://music.yandex.ru/iframe/#playlist/<%= remote_id %>/show/cover/description/\",\n html: '<iframe frameborder=\"0\" style=\"border:none;width:540px;height:400px;\" width=\"540\" height=\"400\"></iframe>',\n height: 400,\n width: 540,\n id: (s) => s.join(\"/\")\n },\n codepen: {\n regex: /https?:\\/\\/codepen\\.io\\/([^\\/\\?\\&]*)\\/pen\\/([^\\/\\?\\&]*)/,\n embedUrl: \"https://codepen.io/<%= remote_id %>?height=300&theme-id=0&default-tab=css,result&embed-version=2\",\n html: \"<iframe height='300' scrolling='no' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'></iframe>\",\n height: 300,\n width: 600,\n id: (s) => s.join(\"/embed/\")\n },\n instagram: {\n //it support both reel and post\n regex: /^https:\\/\\/(?:www\\.)?instagram\\.com\\/(?:reel|p)\\/(.*)/,\n embedUrl: \"https://www.instagram.com/p/<%= remote_id %>/embed\",\n html: '<iframe width=\"400\" height=\"505\" style=\"margin: 0 auto;\" frameborder=\"0\" scrolling=\"no\" allowtransparency=\"true\"></iframe>',\n height: 505,\n width: 400,\n id: (s) => {\n var i;\n return (i = s == null ? void 0 : s[0]) == null ? void 0 : i.split(\"/\")[0];\n }\n },\n twitter: {\n regex: /^https?:\\/\\/(www\\.)?(?:twitter\\.com|x\\.com)\\/.+\\/status\\/(\\d+)/,\n embedUrl: \"https://platform.twitter.com/embed/Tweet.html?id=<%= remote_id %>\",\n html: '<iframe width=\"600\" height=\"600\" style=\"margin: 0 auto;\" frameborder=\"0\" scrolling=\"no\" allowtransparency=\"true\"></iframe>',\n height: 300,\n width: 600,\n id: (s) => s[1]\n },\n pinterest: {\n regex: /https?:\\/\\/([^\\/\\?\\&]*).pinterest.com\\/pin\\/([^\\/\\?\\&]*)\\/?$/,\n embedUrl: \"https://assets.pinterest.com/ext/embed.html?id=<%= remote_id %>\",\n html: \"<iframe scrolling='no' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%; min-height: 400px; max-height: 1000px;'></iframe>\",\n id: (s) => s[1]\n },\n facebook: {\n regex: /https?:\\/\\/www.facebook.com\\/([^\\/\\?\\&]*)\\/(.*)/,\n embedUrl: \"https://www.facebook.com/plugins/post.php?href=https://www.facebook.com/<%= remote_id %>&width=500\",\n html: \"<iframe scrolling='no' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%; min-height: 500px; max-height: 1000px;'></iframe>\",\n id: (s) => s.join(\"/\")\n },\n aparat: {\n regex: /(?:http[s]?:\\/\\/)?(?:www.)?aparat\\.com\\/v\\/([^\\/\\?\\&]+)\\/?/,\n embedUrl: \"https://www.aparat.com/video/video/embed/videohash/<%= remote_id %>/vt/frame\",\n html: '<iframe width=\"600\" height=\"300\" style=\"margin: 0 auto;\" frameborder=\"0\" scrolling=\"no\" allowtransparency=\"true\"></iframe>',\n height: 300,\n width: 600\n },\n miro: {\n regex: /https:\\/\\/miro.com\\/\\S+(\\S{12})\\/(\\S+)?/,\n embedUrl: \"https://miro.com/app/live-embed/<%= remote_id %>\",\n html: '<iframe width=\"700\" height=\"500\" style=\"margin: 0 auto;\" allowFullScreen frameBorder=\"0\" scrolling=\"no\"></iframe>'\n },\n github: {\n regex: /https?:\\/\\/gist.github.com\\/([^\\/\\?\\&]*)\\/([^\\/\\?\\&]*)/,\n embedUrl: 'data:text/html;charset=utf-8,<head><base target=\"_blank\" /></head><body><script src=\"https://gist.github.com/<%= remote_id %>\" ><\\/script></body>',\n html: '<iframe width=\"100%\" height=\"350\" frameborder=\"0\" style=\"margin: 0 auto;\"></iframe>',\n height: 300,\n width: 600,\n id: (s) => `${s.join(\"/\")}.js`\n }\n};\nfunction p(s, i, r) {\n var e, o, l, t, a;\n i == null && (i = 100);\n function n() {\n var d = Date.now() - t;\n d < i && d >= 0 ? e = setTimeout(n, i - d) : (e = null, r || (a = s.apply(l, o), l = o = null));\n }\n var h = function() {\n l = this, o = arguments, t = Date.now();\n var d = r && !e;\n return e || (e = setTimeout(n, i)), d && (a = s.apply(l, o), l = o = null), a;\n };\n return h.clear = function() {\n e && (clearTimeout(e), e = null);\n }, h.flush = function() {\n e && (a = s.apply(l, o), l = o = null, clearTimeout(e), e = null);\n }, h;\n}\np.debounce = p;\nvar w = p;\nclass m {\n /**\n * @param {{data: EmbedData, config: EmbedConfig, api: object}}\n * data \u2014 previously saved data\n * config - user config for Tool\n * api - Editor.js API\n * readOnly - read-only mode flag\n */\n constructor({ data: i, api: r, readOnly: e }) {\n this.api = r, this._data = {}, this.element = null, this.readOnly = e, this.data = i;\n }\n /**\n * @param {EmbedData} data - embed data\n * @param {RegExp} [data.regex] - pattern of source URLs\n * @param {string} [data.embedUrl] - URL scheme to embedded page. Use '<%= remote_id %>' to define a place to insert resource id\n * @param {string} [data.html] - iframe which contains embedded content\n * @param {number} [data.height] - iframe height\n * @param {number} [data.width] - iframe width\n * @param {string} [data.caption] - caption\n */\n set data(i) {\n var h;\n if (!(i instanceof Object))\n throw Error(\"Embed Tool data should be object\");\n const { service: r, source: e, embed: o, width: l, height: t, caption: a = \"\" } = i;\n this._data = {\n service: r || this.data.service,\n source: e || this.data.source,\n embed: o || this.data.embed,\n width: l || this.data.width,\n height: t || this.data.height,\n caption: a || this.data.caption || \"\"\n };\n const n = this.element;\n n && ((h = n.parentNode) == null || h.replaceChild(this.render(), n));\n }\n /**\n * @returns {EmbedData}\n */\n get data() {\n if (this.element) {\n const i = this.element.querySelector(`.${this.api.styles.input}`);\n this._data.caption = i ? i.innerHTML : \"\";\n }\n return this._data;\n }\n /**\n * Get plugin styles\n *\n * @returns {object}\n */\n get CSS() {\n return {\n baseClass: this.api.styles.block,\n input: this.api.styles.input,\n container: \"embed-tool\",\n containerLoading: \"embed-tool--loading\",\n preloader: \"embed-tool__preloader\",\n caption: \"embed-tool__caption\",\n url: \"embed-tool__url\",\n content: \"embed-tool__content\"\n };\n }\n /**\n * Render Embed tool content\n *\n * @returns {HTMLElement}\n */\n render() {\n if (!this.data.service) {\n const a = document.createElement(\"div\");\n return this.element = a, a;\n }\n const { html: i } = m.services[this.data.service], r = document.createElement(\"div\"), e = document.createElement(\"div\"), o = document.createElement(\"template\"), l = this.createPreloader();\n r.classList.add(this.CSS.baseClass, this.CSS.container, this.CSS.containerLoading), e.classList.add(this.CSS.input, this.CSS.caption), r.appendChild(l), e.contentEditable = (!this.readOnly).toString(), e.dataset.placeholder = this.api.i18n.t(\"Enter a caption\"), e.innerHTML = this.data.caption || \"\", o.innerHTML = i, o.content.firstChild.setAttribute(\"src\", this.data.embed), o.content.firstChild.classList.add(this.CSS.content);\n const t = this.embedIsReady(r);\n return o.content.firstChild && r.appendChild(o.content.firstChild), r.appendChild(e), t.then(() => {\n r.classList.remove(this.CSS.containerLoading);\n }), this.element = r, r;\n }\n /**\n * Creates preloader to append to container while data is loading\n *\n * @returns {HTMLElement}\n */\n createPreloader() {\n const i = document.createElement(\"preloader\"), r = document.createElement(\"div\");\n return r.textContent = this.data.source, i.classList.add(this.CSS.preloader), r.classList.add(this.CSS.url), i.appendChild(r), i;\n }\n /**\n * Save current content and return EmbedData object\n *\n * @returns {EmbedData}\n */\n save() {\n return this.data;\n }\n /**\n * Handle pasted url and return Service object\n *\n * @param {PasteEvent} event - event with pasted data\n */\n onPaste(i) {\n var c;\n const { key: r, data: e } = i.detail, { regex: o, embedUrl: l, width: t, height: a, id: n = (u) => u.shift() || \"\" } = m.services[r], h = (c = o.exec(e)) == null ? void 0 : c.slice(1), d = h ? l.replace(/<%= remote_id %>/g, n(h)) : \"\";\n this.data = {\n service: r,\n source: e,\n embed: d,\n width: t,\n height: a\n };\n }\n /**\n * Analyze provided config and make object with services to use\n *\n * @param {EmbedConfig} config - configuration of embed block element\n */\n static prepare({ config: i = {} }) {\n const { services: r = {} } = i;\n let e = Object.entries(g);\n const o = Object.entries(r).filter(([t, a]) => typeof a == \"boolean\" && a === !0).map(([t]) => t), l = Object.entries(r).filter(([t, a]) => typeof a == \"object\").filter(([t, a]) => m.checkServiceConfig(a)).map(([t, a]) => {\n const { regex: n, embedUrl: h, html: d, height: c, width: u, id: f } = a;\n return [t, {\n regex: n,\n embedUrl: h,\n html: d,\n height: c,\n width: u,\n id: f\n }];\n });\n o.length && (e = e.filter(([t]) => o.includes(t))), e = e.concat(l), m.services = e.reduce((t, [a, n]) => a in t ? (t[a] = Object.assign({}, t[a], n), t) : (t[a] = n, t), {}), m.patterns = e.reduce((t, [a, n]) => (n && typeof n != \"boolean\" && (t[a] = n.regex), t), {});\n }\n /**\n * Check if Service config is valid\n *\n * @param {Service} config - configuration of embed block element\n * @returns {boolean}\n */\n static checkServiceConfig(i) {\n const { regex: r, embedUrl: e, html: o, height: l, width: t, id: a } = i;\n let n = !!(r && r instanceof RegExp) && !!(e && typeof e == \"string\") && !!(o && typeof o == \"string\");\n return n = n && (a !== void 0 ? a instanceof Function : !0), n = n && (l !== void 0 ? Number.isFinite(l) : !0), n = n && (t !== void 0 ? Number.isFinite(t) : !0), n;\n }\n /**\n * Paste configuration to enable pasted URLs processing by Editor\n *\n * @returns {object} - object of patterns which contain regx for pasteConfig\n */\n static get pasteConfig() {\n return {\n patterns: m.patterns\n };\n }\n /**\n * Notify core that read-only mode is supported\n *\n * @returns {boolean}\n */\n static get isReadOnlySupported() {\n return !0;\n }\n /**\n * Checks that mutations in DOM have finished after appending iframe content\n *\n * @param {HTMLElement} targetNode - HTML-element mutations of which to listen\n * @returns {Promise<any>} - result that all mutations have finished\n */\n embedIsReady(i) {\n let e;\n return new Promise((o, l) => {\n e = new MutationObserver(w.debounce(o, 450)), e.observe(i, {\n childList: !0,\n subtree: !0\n });\n }).then(() => {\n e.disconnect();\n });\n }\n}\nexport {\n m as default\n};\n", "(function(){var r;\"use strict\";try{if(typeof document<\"u\"){var o=document.createElement(\"style\");o.nonce=(r=document.head.querySelector(\"meta[property=csp-nonce]\"))==null?void 0:r.content,o.appendChild(document.createTextNode('.tc-wrap{--color-background:#f9f9fb;--color-text-secondary:#7b7e89;--color-border:#e8e8eb;--cell-size:34px;--toolbox-icon-size:18px;--toolbox-padding:6px;--toolbox-aiming-field-size:calc(var(--toolbox-icon-size) + var(--toolbox-padding)*2);border-left:0;position:relative;height:100%;width:100%;margin-top:var(--toolbox-icon-size);box-sizing:border-box;display:grid;grid-template-columns:calc(100% - var(--cell-size)) var(--cell-size)}.tc-wrap--readonly{grid-template-columns:100% var(--cell-size)}.tc-wrap svg{vertical-align:top}@media print{.tc-wrap{border-left-color:var(--color-border);border-left-style:solid;border-left-width:1px;grid-template-columns:100% var(--cell-size)}}@media print{.tc-wrap .tc-row:after{display:none}}.tc-table{position:relative;width:100%;height:100%;display:grid;font-size:14px;border-top:1px solid var(--color-border);line-height:1.4}.tc-table:after{width:calc(var(--cell-size));height:100%;left:calc(var(--cell-size)*-1);top:0}.tc-table:after,.tc-table:before{position:absolute;content:\"\"}.tc-table:before{width:100%;height:var(--toolbox-aiming-field-size);top:calc(var(--toolbox-aiming-field-size)*-1);left:0}.tc-table--heading .tc-row:first-child{font-weight:600;border-bottom:2px solid var(--color-border)}.tc-table--heading .tc-row:first-child [contenteditable]:empty:before{content:attr(heading);color:var(--color-text-secondary)}.tc-table--heading .tc-row:first-child:after{bottom:-2px;border-bottom:2px solid var(--color-border)}.tc-add-column,.tc-add-row{display:flex;color:var(--color-text-secondary)}@media print{.tc-add{display:none}}.tc-add-column{padding:4px 0;justify-content:center;border-top:1px solid var(--color-border)}.tc-add-column--disabled{visibility:hidden}@media print{.tc-add-column{display:none}}.tc-add-row{height:var(--cell-size);align-items:center;padding-left:4px;position:relative}.tc-add-row--disabled{display:none}.tc-add-row:before{content:\"\";position:absolute;right:calc(var(--cell-size)*-1);width:var(--cell-size);height:100%}@media print{.tc-add-row{display:none}}.tc-add-column,.tc-add-row{transition:0s;cursor:pointer;will-change:background-color}.tc-add-column:hover,.tc-add-row:hover{transition:background-color .1s ease;background-color:var(--color-background)}.tc-add-row{margin-top:1px}.tc-add-row:hover:before{transition:.1s;background-color:var(--color-background)}.tc-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(10px,1fr));position:relative;border-bottom:1px solid var(--color-border)}.tc-row:after{content:\"\";pointer-events:none;position:absolute;width:var(--cell-size);height:100%;bottom:-1px;right:calc(var(--cell-size)*-1);border-bottom:1px solid var(--color-border)}.tc-row--selected{background:var(--color-background)}.tc-row--selected:after{background:var(--color-background)}.tc-cell{border-right:1px solid var(--color-border);padding:6px 12px;overflow:hidden;outline:none;line-break:normal}.tc-cell--selected{background:var(--color-background)}.tc-wrap--readonly .tc-row:after{display:none}.tc-toolbox{--toolbox-padding:6px;--popover-margin:30px;--toggler-click-zone-size:30px;--toggler-dots-color:#7b7e89;--toggler-dots-color-hovered:#1d202b;position:absolute;cursor:pointer;z-index:1;opacity:0;transition:opacity .1s;will-change:left,opacity}.tc-toolbox--column{top:calc(var(--toggler-click-zone-size)*-1);transform:translate(calc(var(--toggler-click-zone-size)*-1/2));will-change:left,opacity}.tc-toolbox--row{left:calc(var(--popover-margin)*-1);transform:translateY(calc(var(--toggler-click-zone-size)*-1/2));margin-top:-1px;will-change:top,opacity}.tc-toolbox--showed{opacity:1}.tc-toolbox .tc-popover{position:absolute;top:0;left:var(--popover-margin)}.tc-toolbox__toggler{display:flex;align-items:center;justify-content:center;width:var(--toggler-click-zone-size);height:var(--toggler-click-zone-size);color:var(--toggler-dots-color);opacity:0;transition:opacity .15s ease;will-change:opacity}.tc-toolbox__toggler:hover{color:var(--toggler-dots-color-hovered)}.tc-toolbox__toggler svg{fill:currentColor}.tc-wrap:hover .tc-toolbox__toggler{opacity:1}.tc-settings .cdx-settings-button{width:50%;margin:0}.tc-popover{--color-border:#eaeaea;--color-background:#fff;--color-background-hover:rgba(232,232,235,.49);--color-background-confirm:#e24a4a;--color-background-confirm-hover:#d54040;--color-text-confirm:#fff;background:var(--color-background);border:1px solid var(--color-border);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;padding:6px;display:none;will-change:opacity,transform}.tc-popover--opened{display:block;animation:menuShowing .1s cubic-bezier(.215,.61,.355,1) forwards}.tc-popover__item{display:flex;align-items:center;padding:2px 14px 2px 2px;border-radius:5px;cursor:pointer;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tc-popover__item:hover{background:var(--color-background-hover)}.tc-popover__item:not(:last-of-type){margin-bottom:2px}.tc-popover__item-icon{display:inline-flex;width:26px;height:26px;align-items:center;justify-content:center;background:var(--color-background);border-radius:5px;border:1px solid var(--color-border);margin-right:8px}.tc-popover__item-label{line-height:22px;font-size:14px;font-weight:500}.tc-popover__item--confirm{background:var(--color-background-confirm);color:var(--color-text-confirm)}.tc-popover__item--confirm:hover{background-color:var(--color-background-confirm-hover)}.tc-popover__item--confirm .tc-popover__item-icon{background:var(--color-background-confirm);border-color:#0000001a}.tc-popover__item--confirm .tc-popover__item-icon svg{transition:transform .2s ease-in;transform:rotate(90deg) scale(1.2)}.tc-popover__item--hidden{display:none}@keyframes menuShowing{0%{opacity:0;transform:translateY(-8px) scale(.9)}70%{opacity:1;transform:translateY(2px)}to{transform:translateY(0)}}')),document.head.appendChild(o)}}catch(e){console.error(\"vite-plugin-css-injected-by-js\",e)}})();\nfunction c(d, t, e = {}) {\n const o = document.createElement(d);\n Array.isArray(t) ? o.classList.add(...t) : t && o.classList.add(t);\n for (const i in e)\n Object.prototype.hasOwnProperty.call(e, i) && (o[i] = e[i]);\n return o;\n}\nfunction f(d) {\n const t = d.getBoundingClientRect();\n return {\n y1: Math.floor(t.top + window.pageYOffset),\n x1: Math.floor(t.left + window.pageXOffset),\n x2: Math.floor(t.right + window.pageXOffset),\n y2: Math.floor(t.bottom + window.pageYOffset)\n };\n}\nfunction g(d, t) {\n const e = f(d), o = f(t);\n return {\n fromTopBorder: o.y1 - e.y1,\n fromLeftBorder: o.x1 - e.x1,\n fromRightBorder: e.x2 - o.x2,\n fromBottomBorder: e.y2 - o.y2\n };\n}\nfunction k(d, t) {\n const e = d.getBoundingClientRect(), { width: o, height: i, x: n, y: r } = e, { clientX: h, clientY: l } = t;\n return {\n width: o,\n height: i,\n x: h - n,\n y: l - r\n };\n}\nfunction m(d, t) {\n return t.parentNode.insertBefore(d, t);\n}\nfunction C(d, t = !0) {\n const e = document.createRange(), o = window.getSelection();\n e.selectNodeContents(d), e.collapse(t), o.removeAllRanges(), o.addRange(e);\n}\nclass a {\n /**\n * @param {object} options - constructor options\n * @param {PopoverItem[]} options.items - constructor options\n */\n constructor({ items: t }) {\n this.items = t, this.wrapper = void 0, this.itemEls = [];\n }\n /**\n * Set of CSS classnames used in popover\n *\n * @returns {object}\n */\n static get CSS() {\n return {\n popover: \"tc-popover\",\n popoverOpened: \"tc-popover--opened\",\n item: \"tc-popover__item\",\n itemHidden: \"tc-popover__item--hidden\",\n itemConfirmState: \"tc-popover__item--confirm\",\n itemIcon: \"tc-popover__item-icon\",\n itemLabel: \"tc-popover__item-label\"\n };\n }\n /**\n * Returns the popover element\n *\n * @returns {Element}\n */\n render() {\n return this.wrapper = c(\"div\", a.CSS.popover), this.items.forEach((t, e) => {\n const o = c(\"div\", a.CSS.item), i = c(\"div\", a.CSS.itemIcon, {\n innerHTML: t.icon\n }), n = c(\"div\", a.CSS.itemLabel, {\n textContent: t.label\n });\n o.dataset.index = e, o.appendChild(i), o.appendChild(n), this.wrapper.appendChild(o), this.itemEls.push(o);\n }), this.wrapper.addEventListener(\"click\", (t) => {\n this.popoverClicked(t);\n }), this.wrapper;\n }\n /**\n * Popover wrapper click listener\n * Used to delegate clicks in items\n *\n * @returns {void}\n */\n popoverClicked(t) {\n const e = t.target.closest(`.${a.CSS.item}`);\n if (!e)\n return;\n const o = e.dataset.index, i = this.items[o];\n if (i.confirmationRequired && !this.hasConfirmationState(e)) {\n this.setConfirmationState(e);\n return;\n }\n i.onClick();\n }\n /**\n * Enable the confirmation state on passed item\n *\n * @returns {void}\n */\n setConfirmationState(t) {\n t.classList.add(a.CSS.itemConfirmState);\n }\n /**\n * Disable the confirmation state on passed item\n *\n * @returns {void}\n */\n clearConfirmationState(t) {\n t.classList.remove(a.CSS.itemConfirmState);\n }\n /**\n * Check if passed item has the confirmation state\n *\n * @returns {boolean}\n */\n hasConfirmationState(t) {\n return t.classList.contains(a.CSS.itemConfirmState);\n }\n /**\n * Return an opening state\n *\n * @returns {boolean}\n */\n get opened() {\n return this.wrapper.classList.contains(a.CSS.popoverOpened);\n }\n /**\n * Opens the popover\n *\n * @returns {void}\n */\n open() {\n this.items.forEach((t, e) => {\n typeof t.hideIf == \"function\" && this.itemEls[e].classList.toggle(a.CSS.itemHidden, t.hideIf());\n }), this.wrapper.classList.add(a.CSS.popoverOpened);\n }\n /**\n * Closes the popover\n *\n * @returns {void}\n */\n close() {\n this.wrapper.classList.remove(a.CSS.popoverOpened), this.itemEls.forEach((t) => {\n this.clearConfirmationState(t);\n });\n }\n}\nconst R = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7 9L10 12M10 12L7 15M10 12H4\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M17 9L14 12M14 12L17 15M14 12H20\"/></svg>', b = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M8 8L12 12M12 12L16 16M12 12L16 8M12 12L8 16\"/></svg>', x = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M14.8833 9.16666L18.2167 12.5M18.2167 12.5L14.8833 15.8333M18.2167 12.5H10.05C9.16594 12.5 8.31809 12.1488 7.69297 11.5237C7.06785 10.8986 6.71666 10.0507 6.71666 9.16666\"/></svg>', S = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M14.9167 14.9167L11.5833 18.25M11.5833 18.25L8.25 14.9167M11.5833 18.25L11.5833 10.0833C11.5833 9.19928 11.9345 8.35143 12.5596 7.72631C13.1848 7.10119 14.0326 6.75 14.9167 6.75\"/></svg>', y = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9.13333 14.9167L12.4667 18.25M12.4667 18.25L15.8 14.9167M12.4667 18.25L12.4667 10.0833C12.4667 9.19928 12.1155 8.35143 11.4904 7.72631C10.8652 7.10119 10.0174 6.75 9.13333 6.75\"/></svg>', L = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M14.8833 15.8333L18.2167 12.5M18.2167 12.5L14.8833 9.16667M18.2167 12.5L10.05 12.5C9.16595 12.5 8.31811 12.8512 7.69299 13.4763C7.06787 14.1014 6.71667 14.9493 6.71667 15.8333\"/></svg>', M = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M9.41 9.66H9.4\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M14.6 9.66H14.59\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M9.31 14.36H9.3\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2.6\" d=\"M14.6 14.36H14.59\"/></svg>', v = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M12 7V12M12 17V12M17 12H12M12 12H7\"/></svg>', O = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M17 9L20 12L17 15\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M14 12H20\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7 9L4 12L7 15\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 12H10\"/></svg>', T = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-width=\"2\" d=\"M5 10H19\"/><rect width=\"14\" height=\"14\" x=\"5\" y=\"5\" stroke=\"currentColor\" stroke-width=\"2\" rx=\"4\"/></svg>', H = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-width=\"2\" d=\"M10 5V18.5\"/><path stroke=\"currentColor\" stroke-width=\"2\" d=\"M14 5V18.5\"/><path stroke=\"currentColor\" stroke-width=\"2\" d=\"M5 10H19\"/><path stroke=\"currentColor\" stroke-width=\"2\" d=\"M5 14H19\"/><rect width=\"14\" height=\"14\" x=\"5\" y=\"5\" stroke=\"currentColor\" stroke-width=\"2\" rx=\"4\"/></svg>', A = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-width=\"2\" d=\"M10 5V18.5\"/><path stroke=\"currentColor\" stroke-width=\"2\" d=\"M5 10H19\"/><rect width=\"14\" height=\"14\" x=\"5\" y=\"5\" stroke=\"currentColor\" stroke-width=\"2\" rx=\"4\"/></svg>';\nclass w {\n /**\n * Creates toolbox buttons and toolbox menus\n *\n * @param {Object} config\n * @param {any} config.api - Editor.js api\n * @param {PopoverItem[]} config.items - Editor.js api\n * @param {function} config.onOpen - callback fired when the Popover is opening\n * @param {function} config.onClose - callback fired when the Popover is closing\n * @param {string} config.cssModifier - the modifier for the Toolbox. Allows to add some specific styles.\n */\n constructor({ api: t, items: e, onOpen: o, onClose: i, cssModifier: n = \"\" }) {\n this.api = t, this.items = e, this.onOpen = o, this.onClose = i, this.cssModifier = n, this.popover = null, this.wrapper = this.createToolbox();\n }\n /**\n * Style classes\n */\n static get CSS() {\n return {\n toolbox: \"tc-toolbox\",\n toolboxShowed: \"tc-toolbox--showed\",\n toggler: \"tc-toolbox__toggler\"\n };\n }\n /**\n * Returns rendered Toolbox element\n */\n get element() {\n return this.wrapper;\n }\n /**\n * Creating a toolbox to open menu for a manipulating columns\n *\n * @returns {Element}\n */\n createToolbox() {\n const t = c(\"div\", [\n w.CSS.toolbox,\n this.cssModifier ? `${w.CSS.toolbox}--${this.cssModifier}` : \"\"\n ]);\n t.dataset.mutationFree = \"true\";\n const e = this.createPopover(), o = this.createToggler();\n return t.appendChild(o), t.appendChild(e), t;\n }\n /**\n * Creates the Toggler\n *\n * @returns {Element}\n */\n createToggler() {\n const t = c(\"div\", w.CSS.toggler, {\n innerHTML: M\n });\n return t.addEventListener(\"click\", () => {\n this.togglerClicked();\n }), t;\n }\n /**\n * Creates the Popover instance and render it\n *\n * @returns {Element}\n */\n createPopover() {\n return this.popover = new a({\n items: this.items\n }), this.popover.render();\n }\n /**\n * Toggler click handler. Opens/Closes the popover\n *\n * @returns {void}\n */\n togglerClicked() {\n this.popover.opened ? (this.popover.close(), this.onClose()) : (this.popover.open(), this.onOpen());\n }\n /**\n * Shows the Toolbox\n *\n * @param {function} computePositionMethod - method that returns the position coordinate\n * @returns {void}\n */\n show(t) {\n const e = t();\n Object.entries(e).forEach(([o, i]) => {\n this.wrapper.style[o] = i;\n }), this.wrapper.classList.add(w.CSS.toolboxShowed);\n }\n /**\n * Hides the Toolbox\n *\n * @returns {void}\n */\n hide() {\n this.popover.close(), this.wrapper.classList.remove(w.CSS.toolboxShowed);\n }\n}\nfunction B(d, t) {\n let e = 0;\n return function(...o) {\n const i = (/* @__PURE__ */ new Date()).getTime();\n if (!(i - e < d))\n return e = i, t(...o);\n };\n}\nconst s = {\n wrapper: \"tc-wrap\",\n wrapperReadOnly: \"tc-wrap--readonly\",\n table: \"tc-table\",\n row: \"tc-row\",\n withHeadings: \"tc-table--heading\",\n rowSelected: \"tc-row--selected\",\n cell: \"tc-cell\",\n cellSelected: \"tc-cell--selected\",\n addRow: \"tc-add-row\",\n addRowDisabled: \"tc-add-row--disabled\",\n addColumn: \"tc-add-column\",\n addColumnDisabled: \"tc-add-column--disabled\"\n};\nclass E {\n /**\n * Creates\n *\n * @constructor\n * @param {boolean} readOnly - read-only mode flag\n * @param {object} api - Editor.js API\n * @param {TableData} data - Editor.js API\n * @param {TableConfig} config - Editor.js API\n */\n constructor(t, e, o, i) {\n this.readOnly = t, this.api = e, this.data = o, this.config = i, this.wrapper = null, this.table = null, this.toolboxColumn = this.createColumnToolbox(), this.toolboxRow = this.createRowToolbox(), this.createTableWrapper(), this.hoveredRow = 0, this.hoveredColumn = 0, this.selectedRow = 0, this.selectedColumn = 0, this.tunes = {\n withHeadings: !1\n }, this.resize(), this.fill(), this.focusedCell = {\n row: 0,\n column: 0\n }, this.documentClicked = (n) => {\n const r = n.target.closest(`.${s.table}`) !== null, h = n.target.closest(`.${s.wrapper}`) === null;\n (r || h) && this.hideToolboxes();\n const u = n.target.closest(`.${s.addRow}`), p = n.target.closest(`.${s.addColumn}`);\n u && u.parentNode === this.wrapper ? (this.addRow(void 0, !0), this.hideToolboxes()) : p && p.parentNode === this.wrapper && (this.addColumn(void 0, !0), this.hideToolboxes());\n }, this.readOnly || this.bindEvents();\n }\n /**\n * Returns the rendered table wrapper\n *\n * @returns {Element}\n */\n getWrapper() {\n return this.wrapper;\n }\n /**\n * Hangs the necessary handlers to events\n */\n bindEvents() {\n document.addEventListener(\"click\", this.documentClicked), this.table.addEventListener(\"mousemove\", B(150, (t) => this.onMouseMoveInTable(t)), { passive: !0 }), this.table.onkeypress = (t) => this.onKeyPressListener(t), this.table.addEventListener(\"keydown\", (t) => this.onKeyDownListener(t)), this.table.addEventListener(\"focusin\", (t) => this.focusInTableListener(t));\n }\n /**\n * Configures and creates the toolbox for manipulating with columns\n *\n * @returns {Toolbox}\n */\n createColumnToolbox() {\n return new w({\n api: this.api,\n cssModifier: \"column\",\n items: [\n {\n label: this.api.i18n.t(\"Add column to left\"),\n icon: S,\n hideIf: () => this.numberOfColumns === this.config.maxcols,\n onClick: () => {\n this.addColumn(this.selectedColumn, !0), this.hideToolboxes();\n }\n },\n {\n label: this.api.i18n.t(\"Add column to right\"),\n icon: y,\n hideIf: () => this.numberOfColumns === this.config.maxcols,\n onClick: () => {\n this.addColumn(this.selectedColumn + 1, !0), this.hideToolboxes();\n }\n },\n {\n label: this.api.i18n.t(\"Delete column\"),\n icon: b,\n hideIf: () => this.numberOfColumns === 1,\n confirmationRequired: !0,\n onClick: () => {\n this.deleteColumn(this.selectedColumn), this.hideToolboxes();\n }\n }\n ],\n onOpen: () => {\n this.selectColumn(this.hoveredColumn), this.hideRowToolbox();\n },\n onClose: () => {\n this.unselectColumn();\n }\n });\n }\n /**\n * Configures and creates the toolbox for manipulating with rows\n *\n * @returns {Toolbox}\n */\n createRowToolbox() {\n return new w({\n api: this.api,\n cssModifier: \"row\",\n items: [\n {\n label: this.api.i18n.t(\"Add row above\"),\n icon: L,\n hideIf: () => this.numberOfRows === this.config.maxrows,\n onClick: () => {\n this.addRow(this.selectedRow, !0), this.hideToolboxes();\n }\n },\n {\n label: this.api.i18n.t(\"Add row below\"),\n icon: x,\n hideIf: () => this.numberOfRows === this.config.maxrows,\n onClick: () => {\n this.addRow(this.selectedRow + 1, !0), this.hideToolboxes();\n }\n },\n {\n label: this.api.i18n.t(\"Delete row\"),\n icon: b,\n hideIf: () => this.numberOfRows === 1,\n confirmationRequired: !0,\n onClick: () => {\n this.deleteRow(this.selectedRow), this.hideToolboxes();\n }\n }\n ],\n onOpen: () => {\n this.selectRow(this.hoveredRow), this.hideColumnToolbox();\n },\n onClose: () => {\n this.unselectRow();\n }\n });\n }\n /**\n * When you press enter it moves the cursor down to the next row\n * or creates it if the click occurred on the last one\n */\n moveCursorToNextRow() {\n this.focusedCell.row !== this.numberOfRows ? (this.focusedCell.row += 1, this.focusCell(this.focusedCell)) : (this.addRow(), this.focusedCell.row += 1, this.focusCell(this.focusedCell), this.updateToolboxesPosition(0, 0));\n }\n /**\n * Get table cell by row and col index\n *\n * @param {number} row - cell row coordinate\n * @param {number} column - cell column coordinate\n * @returns {HTMLElement}\n */\n getCell(t, e) {\n return this.table.querySelectorAll(`.${s.row}:nth-child(${t}) .${s.cell}`)[e - 1];\n }\n /**\n * Get table row by index\n *\n * @param {number} row - row coordinate\n * @returns {HTMLElement}\n */\n getRow(t) {\n return this.table.querySelector(`.${s.row}:nth-child(${t})`);\n }\n /**\n * The parent of the cell which is the row\n *\n * @param {HTMLElement} cell - cell element\n * @returns {HTMLElement}\n */\n getRowByCell(t) {\n return t.parentElement;\n }\n /**\n * Ger row's first cell\n *\n * @param {Element} row - row to find its first cell\n * @returns {Element}\n */\n getRowFirstCell(t) {\n return t.querySelector(`.${s.cell}:first-child`);\n }\n /**\n * Set the sell's content by row and column numbers\n *\n * @param {number} row - cell row coordinate\n * @param {number} column - cell column coordinate\n * @param {string} content - cell HTML content\n */\n setCellContent(t, e, o) {\n const i = this.getCell(t, e);\n i.innerHTML = o;\n }\n /**\n * Add column in table on index place\n * Add cells in each row\n *\n * @param {number} columnIndex - number in the array of columns, where new column to insert, -1 if insert at the end\n * @param {boolean} [setFocus] - pass true to focus the first cell\n */\n addColumn(t = -1, e = !1) {\n var n;\n let o = this.numberOfColumns;\n if (this.config && this.config.maxcols && this.numberOfColumns >= this.config.maxcols)\n return;\n for (let r = 1; r <= this.numberOfRows; r++) {\n let h;\n const l = this.createCell();\n if (t > 0 && t <= o ? (h = this.getCell(r, t), m(l, h)) : h = this.getRow(r).appendChild(l), r === 1) {\n const u = this.getCell(r, t > 0 ? t : o + 1);\n u && e && C(u);\n }\n }\n const i = this.wrapper.querySelector(`.${s.addColumn}`);\n (n = this.config) != null && n.maxcols && this.numberOfColumns > this.config.maxcols - 1 && i && i.classList.add(s.addColumnDisabled), this.addHeadingAttrToFirstRow();\n }\n /**\n * Add row in table on index place\n *\n * @param {number} index - number in the array of rows, where new column to insert, -1 if insert at the end\n * @param {boolean} [setFocus] - pass true to focus the inserted row\n * @returns {HTMLElement} row\n */\n addRow(t = -1, e = !1) {\n let o, i = c(\"div\", s.row);\n this.tunes.withHeadings && this.removeHeadingAttrFromFirstRow();\n let n = this.numberOfColumns;\n if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && h)\n return;\n if (t > 0 && t <= this.numberOfRows) {\n let l = this.getRow(t);\n o = m(i, l);\n } else\n o = this.table.appendChild(i);\n this.fillRow(o, n), this.tunes.withHeadings && this.addHeadingAttrToFirstRow();\n const r = this.getRowFirstCell(o);\n r && e && C(r);\n const h = this.wrapper.querySelector(`.${s.addRow}`);\n return this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && h && h.classList.add(s.addRowDisabled), o;\n }\n /**\n * Delete a column by index\n *\n * @param {number} index\n */\n deleteColumn(t) {\n for (let o = 1; o <= this.numberOfRows; o++) {\n const i = this.getCell(o, t);\n if (!i)\n return;\n i.remove();\n }\n const e = this.wrapper.querySelector(`.${s.addColumn}`);\n e && e.classList.remove(s.addColumnDisabled);\n }\n /**\n * Delete a row by index\n *\n * @param {number} index\n */\n deleteRow(t) {\n this.getRow(t).remove();\n const e = this.wrapper.querySelector(`.${s.addRow}`);\n e && e.classList.remove(s.addRowDisabled), this.addHeadingAttrToFirstRow();\n }\n /**\n * Create a wrapper containing a table, toolboxes\n * and buttons for adding rows and columns\n *\n * @returns {HTMLElement} wrapper - where all buttons for a table and the table itself will be\n */\n createTableWrapper() {\n if (this.wrapper = c(\"div\", s.wrapper), this.table = c(\"div\", s.table), this.readOnly && this.wrapper.classList.add(s.wrapperReadOnly), this.wrapper.appendChild(this.toolboxRow.element), this.wrapper.appendChild(this.toolboxColumn.element), this.wrapper.appendChild(this.table), !this.readOnly) {\n const t = c(\"div\", s.addColumn, {\n innerHTML: v\n }), e = c(\"div\", s.addRow, {\n innerHTML: v\n });\n this.wrapper.appendChild(t), this.wrapper.appendChild(e);\n }\n }\n /**\n * Returns the size of the table based on initial data or config \"size\" property\n *\n * @return {{rows: number, cols: number}} - number of cols and rows\n */\n computeInitialSize() {\n const t = this.data && this.data.content, e = Array.isArray(t), o = e ? t.length : !1, i = e ? t.length : void 0, n = o ? t[0].length : void 0, r = Number.parseInt(this.config && this.config.rows), h = Number.parseInt(this.config && this.config.cols), l = !isNaN(r) && r > 0 ? r : void 0, u = !isNaN(h) && h > 0 ? h : void 0;\n return {\n rows: i || l || 2,\n cols: n || u || 2\n };\n }\n /**\n * Resize table to match config size or transmitted data size\n *\n * @return {{rows: number, cols: number}} - number of cols and rows\n */\n resize() {\n const { rows: t, cols: e } = this.computeInitialSize();\n for (let o = 0; o < t; o++)\n this.addRow();\n for (let o = 0; o < e; o++)\n this.addColumn();\n }\n /**\n * Fills the table with data passed to the constructor\n *\n * @returns {void}\n */\n fill() {\n const t = this.data;\n if (t && t.content)\n for (let e = 0; e < t.content.length; e++)\n for (let o = 0; o < t.content[e].length; o++)\n this.setCellContent(e + 1, o + 1, t.content[e][o]);\n }\n /**\n * Fills a row with cells\n *\n * @param {HTMLElement} row - row to fill\n * @param {number} numberOfColumns - how many cells should be in a row\n */\n fillRow(t, e) {\n for (let o = 1; o <= e; o++) {\n const i = this.createCell();\n t.appendChild(i);\n }\n }\n /**\n * Creating a cell element\n *\n * @return {Element}\n */\n createCell() {\n return c(\"div\", s.cell, {\n contentEditable: !this.readOnly\n });\n }\n /**\n * Get number of rows in the table\n */\n get numberOfRows() {\n return this.table.childElementCount;\n }\n /**\n * Get number of columns in the table\n */\n get numberOfColumns() {\n return this.numberOfRows ? this.table.querySelectorAll(`.${s.row}:first-child .${s.cell}`).length : 0;\n }\n /**\n * Is the column toolbox menu displayed or not\n *\n * @returns {boolean}\n */\n get isColumnMenuShowing() {\n return this.selectedColumn !== 0;\n }\n /**\n * Is the row toolbox menu displayed or not\n *\n * @returns {boolean}\n */\n get isRowMenuShowing() {\n return this.selectedRow !== 0;\n }\n /**\n * Recalculate position of toolbox icons\n *\n * @param {Event} event - mouse move event\n */\n onMouseMoveInTable(t) {\n const { row: e, column: o } = this.getHoveredCell(t);\n this.hoveredColumn = o, this.hoveredRow = e, this.updateToolboxesPosition();\n }\n /**\n * Prevents default Enter behaviors\n * Adds Shift+Enter processing\n *\n * @param {KeyboardEvent} event - keypress event\n */\n onKeyPressListener(t) {\n if (t.key === \"Enter\") {\n if (t.shiftKey)\n return !0;\n this.moveCursorToNextRow();\n }\n return t.key !== \"Enter\";\n }\n /**\n * Prevents tab keydown event from bubbling\n * so that it only works inside the table\n *\n * @param {KeyboardEvent} event - keydown event\n */\n onKeyDownListener(t) {\n t.key === \"Tab\" && t.stopPropagation();\n }\n /**\n * Set the coordinates of the cell that the focus has moved to\n *\n * @param {FocusEvent} event - focusin event\n */\n focusInTableListener(t) {\n const e = t.target, o = this.getRowByCell(e);\n this.focusedCell = {\n row: Array.from(this.table.querySelectorAll(`.${s.row}`)).indexOf(o) + 1,\n column: Array.from(o.querySelectorAll(`.${s.cell}`)).indexOf(e) + 1\n };\n }\n /**\n * Unselect row/column\n * Close toolbox menu\n * Hide toolboxes\n *\n * @returns {void}\n */\n hideToolboxes() {\n this.hideRowToolbox(), this.hideColumnToolbox(), this.updateToolboxesPosition();\n }\n /**\n * Unselect row, close toolbox\n *\n * @returns {void}\n */\n hideRowToolbox() {\n this.unselectRow(), this.toolboxRow.hide();\n }\n /**\n * Unselect column, close toolbox\n *\n * @returns {void}\n */\n hideColumnToolbox() {\n this.unselectColumn(), this.toolboxColumn.hide();\n }\n /**\n * Set the cursor focus to the focused cell\n *\n * @returns {void}\n */\n focusCell() {\n this.focusedCellElem.focus();\n }\n /**\n * Get current focused element\n *\n * @returns {HTMLElement} - focused cell\n */\n get focusedCellElem() {\n const { row: t, column: e } = this.focusedCell;\n return this.getCell(t, e);\n }\n /**\n * Update toolboxes position\n *\n * @param {number} row - hovered row\n * @param {number} column - hovered column\n */\n updateToolboxesPosition(t = this.hoveredRow, e = this.hoveredColumn) {\n this.isColumnMenuShowing || e > 0 && e <= this.numberOfColumns && this.toolboxColumn.show(() => ({\n left: `calc((100% - var(--cell-size)) / (${this.numberOfColumns} * 2) * (1 + (${e} - 1) * 2))`\n })), this.isRowMenuShowing || t > 0 && t <= this.numberOfRows && this.toolboxRow.show(() => {\n const o = this.getRow(t), { fromTopBorder: i } = g(this.table, o), { height: n } = o.getBoundingClientRect();\n return {\n top: `${Math.ceil(i + n / 2)}px`\n };\n });\n }\n /**\n * Makes the first row headings\n *\n * @param {boolean} withHeadings - use headings row or not\n */\n setHeadingsSetting(t) {\n this.tunes.withHeadings = t, t ? (this.table.classList.add(s.withHeadings), this.addHeadingAttrToFirstRow()) : (this.table.classList.remove(s.withHeadings), this.removeHeadingAttrFromFirstRow());\n }\n /**\n * Adds an attribute for displaying the placeholder in the cell\n */\n addHeadingAttrToFirstRow() {\n for (let t = 1; t <= this.numberOfColumns; t++) {\n let e = this.getCell(1, t);\n e && e.setAttribute(\"heading\", this.api.i18n.t(\"Heading\"));\n }\n }\n /**\n * Removes an attribute for displaying the placeholder in the cell\n */\n removeHeadingAttrFromFirstRow() {\n for (let t = 1; t <= this.numberOfColumns; t++) {\n let e = this.getCell(1, t);\n e && e.removeAttribute(\"heading\");\n }\n }\n /**\n * Add effect of a selected row\n *\n * @param {number} index\n */\n selectRow(t) {\n const e = this.getRow(t);\n e && (this.selectedRow = t, e.classList.add(s.rowSelected));\n }\n /**\n * Remove effect of a selected row\n */\n unselectRow() {\n if (this.selectedRow <= 0)\n return;\n const t = this.table.querySelector(`.${s.rowSelected}`);\n t && t.classList.remove(s.rowSelected), this.selectedRow = 0;\n }\n /**\n * Add effect of a selected column\n *\n * @param {number} index\n */\n selectColumn(t) {\n for (let e = 1; e <= this.numberOfRows; e++) {\n const o = this.getCell(e, t);\n o && o.classList.add(s.cellSelected);\n }\n this.selectedColumn = t;\n }\n /**\n * Remove effect of a selected column\n */\n unselectColumn() {\n if (this.selectedColumn <= 0)\n return;\n let t = this.table.querySelectorAll(`.${s.cellSelected}`);\n Array.from(t).forEach((e) => {\n e.classList.remove(s.cellSelected);\n }), this.selectedColumn = 0;\n }\n /**\n * Calculates the row and column that the cursor is currently hovering over\n * The search was optimized from O(n) to O (log n) via bin search to reduce the number of calculations\n *\n * @param {Event} event - mousemove event\n * @returns hovered cell coordinates as an integer row and column\n */\n getHoveredCell(t) {\n let e = this.hoveredRow, o = this.hoveredColumn;\n const { width: i, height: n, x: r, y: h } = k(this.table, t);\n return r >= 0 && (o = this.binSearch(\n this.numberOfColumns,\n (l) => this.getCell(1, l),\n ({ fromLeftBorder: l }) => r < l,\n ({ fromRightBorder: l }) => r > i - l\n )), h >= 0 && (e = this.binSearch(\n this.numberOfRows,\n (l) => this.getCell(l, 1),\n ({ fromTopBorder: l }) => h < l,\n ({ fromBottomBorder: l }) => h > n - l\n )), {\n row: e || this.hoveredRow,\n column: o || this.hoveredColumn\n };\n }\n /**\n * Looks for the index of the cell the mouse is hovering over.\n * Cells can be represented as ordered intervals with left and\n * right (upper and lower for rows) borders inside the table, if the mouse enters it, then this is our index\n *\n * @param {number} numberOfCells - upper bound of binary search\n * @param {function} getCell - function to take the currently viewed cell\n * @param {function} beforeTheLeftBorder - determines the cursor position, to the left of the cell or not\n * @param {function} afterTheRightBorder - determines the cursor position, to the right of the cell or not\n * @returns {number}\n */\n binSearch(t, e, o, i) {\n let n = 0, r = t + 1, h = 0, l;\n for (; n < r - 1 && h < 10; ) {\n l = Math.ceil((n + r) / 2);\n const u = e(l), p = g(this.table, u);\n if (o(p))\n r = l;\n else if (i(p))\n n = l;\n else\n break;\n h++;\n }\n return l;\n }\n /**\n * Collects data from cells into a two-dimensional array\n *\n * @returns {string[][]}\n */\n getData() {\n const t = [];\n for (let e = 1; e <= this.numberOfRows; e++) {\n const o = this.table.querySelector(`.${s.row}:nth-child(${e})`), i = Array.from(o.querySelectorAll(`.${s.cell}`));\n i.every((r) => !r.textContent.trim()) || t.push(i.map((r) => r.innerHTML));\n }\n return t;\n }\n /**\n * Remove listeners on the document\n */\n destroy() {\n document.removeEventListener(\"click\", this.documentClicked);\n }\n}\nclass F {\n /**\n * Notify core that read-only mode is supported\n *\n * @returns {boolean}\n */\n static get isReadOnlySupported() {\n return !0;\n }\n /**\n * Allow to press Enter inside the CodeTool textarea\n *\n * @returns {boolean}\n * @public\n */\n static get enableLineBreaks() {\n return !0;\n }\n /**\n * Render plugin`s main Element and fill it with saved data\n *\n * @param {TableConstructor} init\n */\n constructor({ data: t, config: e, api: o, readOnly: i, block: n }) {\n this.api = o, this.readOnly = i, this.config = e, this.data = {\n withHeadings: this.getConfig(\"withHeadings\", !1, t),\n stretched: this.getConfig(\"stretched\", !1, t),\n content: t && t.content ? t.content : []\n }, this.table = null, this.block = n;\n }\n /**\n * Get Tool toolbox settings\n * icon - Tool icon's SVG\n * title - title to show in toolbox\n *\n * @returns {{icon: string, title: string}}\n */\n static get toolbox() {\n return {\n icon: A,\n title: \"Table\"\n };\n }\n /**\n * Return Tool's view\n *\n * @returns {HTMLDivElement}\n */\n render() {\n return this.table = new E(this.readOnly, this.api, this.data, this.config), this.container = c(\"div\", this.api.styles.block), this.container.appendChild(this.table.getWrapper()), this.table.setHeadingsSetting(this.data.withHeadings), this.container;\n }\n /**\n * Returns plugin settings\n *\n * @returns {Array}\n */\n renderSettings() {\n return [\n {\n label: this.api.i18n.t(\"With headings\"),\n icon: T,\n isActive: this.data.withHeadings,\n closeOnActivate: !0,\n toggle: !0,\n onActivate: () => {\n this.data.withHeadings = !0, this.table.setHeadingsSetting(this.data.withHeadings);\n }\n },\n {\n label: this.api.i18n.t(\"Without headings\"),\n icon: H,\n isActive: !this.data.withHeadings,\n closeOnActivate: !0,\n toggle: !0,\n onActivate: () => {\n this.data.withHeadings = !1, this.table.setHeadingsSetting(this.data.withHeadings);\n }\n },\n {\n label: this.data.stretched ? this.api.i18n.t(\"Collapse\") : this.api.i18n.t(\"Stretch\"),\n icon: this.data.stretched ? R : O,\n closeOnActivate: !0,\n toggle: !0,\n onActivate: () => {\n this.data.stretched = !this.data.stretched, this.block.stretched = this.data.stretched;\n }\n }\n ];\n }\n /**\n * Extract table data from the view\n *\n * @returns {TableData} - saved data\n */\n save() {\n const t = this.table.getData();\n return {\n withHeadings: this.data.withHeadings,\n stretched: this.data.stretched,\n content: t\n };\n }\n /**\n * Plugin destroyer\n *\n * @returns {void}\n */\n destroy() {\n this.table.destroy();\n }\n /**\n * A helper to get config value.\n *\n * @param {string} configName - the key to get from the config.\n * @param {any} defaultValue - default value if config doesn't have passed key\n * @param {object} savedData - previously saved data. If passed, the key will be got from there, otherwise from the config\n * @returns {any} - config value.\n */\n getConfig(t, e = void 0, o = void 0) {\n const i = this.data || o;\n return i ? i[t] ? i[t] : e : this.config && this.config[t] ? this.config[t] : e;\n }\n /**\n * Table onPaste configuration\n *\n * @public\n */\n static get pasteConfig() {\n return { tags: [\"TABLE\", \"TR\", \"TH\", \"TD\"] };\n }\n /**\n * On paste callback that is fired from Editor\n *\n * @param {PasteEvent} event - event with pasted data\n */\n onPaste(t) {\n const e = t.detail.data, o = e.querySelector(\":scope > thead, tr:first-of-type th\"), n = Array.from(e.querySelectorAll(\"tr\")).map((r) => Array.from(r.querySelectorAll(\"th, td\")).map((l) => l.innerHTML));\n this.data = {\n withHeadings: o !== null,\n content: n\n }, this.table.wrapper && this.table.wrapper.replaceWith(this.render());\n }\n}\nexport {\n F as default\n};\n", "(function(){\"use strict\";try{if(typeof document<\"u\"){var e=document.createElement(\"style\");e.appendChild(document.createTextNode(\".cdx-underline{text-decoration:underline}\")),document.head.appendChild(e)}}catch(n){console.error(\"vite-plugin-css-injected-by-js\",n)}})();\nconst r = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 7.5V11.5C9 12.2956 9.31607 13.0587 9.87868 13.6213C10.4413 14.1839 11.2044 14.5 12 14.5C12.7956 14.5 13.5587 14.1839 14.1213 13.6213C14.6839 13.0587 15 12.2956 15 11.5V7.5\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7.71429 18H16.2857\"/></svg>', s = class s {\n /**\n * @param options InlineToolConstructorOptions\n */\n constructor(e) {\n this.tag = \"U\", this.api = e.api, this.iconClasses = {\n base: this.api.styles.inlineToolButton,\n active: this.api.styles.inlineToolButtonActive\n };\n }\n /**\n * Class name for term-tag\n *\n * @type {string}\n */\n static get CSS() {\n return \"cdx-underline\";\n }\n /**\n * Create button element for Toolbar\n *\n * @returns {HTMLElement}\n */\n render() {\n return this.button = document.createElement(\"button\"), this.button.type = \"button\", this.button.classList.add(this.iconClasses.base), this.button.innerHTML = this.toolboxIcon, this.button;\n }\n /**\n * Wrap/Unwrap selected fragment\n *\n * @param {Range} range - selected fragment\n */\n surround(e) {\n if (!e)\n return;\n const t = this.api.selection.findParentTag(this.tag, s.CSS);\n t ? this.unwrap(t) : this.wrap(e);\n }\n /**\n * Wrap selection with term-tag\n *\n * @param {Range} range - selected fragment\n */\n wrap(e) {\n const t = document.createElement(this.tag);\n t.classList.add(s.CSS), t.appendChild(e.extractContents()), e.insertNode(t), this.api.selection.expandToTag(t);\n }\n /**\n * Unwrap term-tag\n *\n * @param {HTMLElement} termWrapper - term wrapper tag\n */\n unwrap(e) {\n var o;\n this.api.selection.expandToTag(e);\n const t = window.getSelection();\n if (!t)\n return;\n const n = t.getRangeAt(0);\n if (!n)\n return;\n const i = n.extractContents();\n i && ((o = e.parentNode) == null || o.removeChild(e), n.insertNode(i), t.removeAllRanges(), t.addRange(n));\n }\n /**\n * Check and change Term's state for current selection\n */\n checkState() {\n var t;\n const e = this.api.selection.findParentTag(this.tag, s.CSS);\n return (t = this.button) == null || t.classList.toggle(this.iconClasses.active, !!e), !!e;\n }\n /**\n * Get Tool icon's SVG\n *\n * @returns {string}\n */\n get toolboxIcon() {\n return r;\n }\n /**\n * Sanitizer rule\n *\n * @returns {{u: {class: string}}}\n */\n static get sanitize() {\n return {\n u: {\n class: s.CSS\n }\n };\n }\n};\ns.isInline = !0;\nlet a = s;\nexport {\n a as default\n};\n", "(function(){\"use strict\";try{if(typeof document<\"u\"){var o=document.createElement(\"style\");o.appendChild(document.createTextNode(`.link-tool{position:relative}.link-tool__input{padding-left:38px;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath stroke='%23707684' stroke-linecap='round' stroke-width='2' d='m7.7 12.6-.021.02a2.795 2.795 0 0 0-.044 4.005v0a2.795 2.795 0 0 0 3.936.006l1.455-1.438a3 3 0 0 0 .34-3.866l-.146-.207'/%3E%3Cpath stroke='%23707684' stroke-linecap='round' stroke-width='2' d='m16.22 11.12.136-.14c.933-.954.992-2.46.135-3.483v0a2.597 2.597 0 0 0-3.664-.32L11.39 8.386a3 3 0 0 0-.301 4.3l.031.034'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.link-tool__input-holder{position:relative}.link-tool__input-holder--error .link-tool__input{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath stroke='rgb(224, 147, 147)' stroke-linecap='round' stroke-width='2' d='m7.7 12.6-.021.02a2.795 2.795 0 0 0-.044 4.005v0a2.795 2.795 0 0 0 3.936.006l1.455-1.438a3 3 0 0 0 .34-3.866l-.146-.207'/%3E%3Cpath stroke='rgb(224, 147, 147)' stroke-linecap='round' stroke-width='2' d='m16.22 11.12.136-.14c.933-.954.992-2.46.135-3.483v0a2.597 2.597 0 0 0-3.664-.32L11.39 8.386a3 3 0 0 0-.301 4.3l.031.034'/%3E%3C/svg%3E\");background-color:#fff3f6;border-color:#f3e0e0;color:#a95a5a;box-shadow:inset 0 1px 3px #923e3e0d}.link-tool__input[contentEditable=true][data-placeholder]:before{position:absolute;content:attr(data-placeholder);color:#707684;font-weight:400;opacity:0}.link-tool__input[contentEditable=true][data-placeholder]:empty:before{opacity:1}.link-tool__input[contentEditable=true][data-placeholder]:empty:focus:before{opacity:0}.link-tool__progress{position:absolute;box-shadow:inset 0 1px 3px #66556b0a;height:100%;width:0;background-color:#f4f5f7;z-index:-1}.link-tool__progress--loading{-webkit-animation:progress .5s ease-in;-webkit-animation-fill-mode:forwards}.link-tool__progress--loaded{width:100%}.link-tool__content{display:block;padding:25px;border-radius:2px;box-shadow:0 0 0 2px #fff;color:initial!important;text-decoration:none!important}.link-tool__content:after{content:\"\";clear:both;display:table}.link-tool__content--rendered{background:#fff;border:1px solid rgba(201,201,204,.48);box-shadow:0 1px 3px #0000001a;border-radius:6px;will-change:filter;animation:link-in .45s 1 cubic-bezier(.215,.61,.355,1)}.link-tool__content--rendered:hover{box-shadow:0 0 3px #00000029}.link-tool__image{background-position:center center;background-repeat:no-repeat;background-size:cover;margin:0 0 0 30px;width:65px;height:65px;border-radius:3px;float:right}.link-tool__title{font-size:17px;font-weight:600;line-height:1.5em;margin:0 0 10px}.link-tool__title+.link-tool__anchor{margin-top:25px}.link-tool__description{margin:0 0 20px;font-size:15px;line-height:1.55em;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.link-tool__anchor{display:block;font-size:15px;line-height:1em;color:#888!important;border:0!important;padding:0!important}@keyframes link-in{0%{filter:blur(5px)}to{filter:none}}.codex-editor--narrow .link-tool__image{display:none}@-webkit-keyframes progress{0%{width:0}to{width:85%}}`)),document.head.appendChild(o)}}catch(t){console.error(\"vite-plugin-css-injected-by-js\",t)}})();\nvar C = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {};\nfunction O(k) {\n return k && k.__esModule && Object.prototype.hasOwnProperty.call(k, \"default\") ? k.default : k;\n}\n(function(k) {\n var w = function() {\n try {\n return !!Symbol.iterator;\n } catch {\n return !1;\n }\n }, d = w(), v = function(n) {\n var o = {\n next: function() {\n var e = n.shift();\n return { done: e === void 0, value: e };\n }\n };\n return d && (o[Symbol.iterator] = function() {\n return o;\n }), o;\n }, c = function(n) {\n return encodeURIComponent(n).replace(/%20/g, \"+\");\n }, i = function(n) {\n return decodeURIComponent(String(n).replace(/\\+/g, \" \"));\n }, a = function() {\n var n = function(e) {\n Object.defineProperty(this, \"_entries\", { writable: !0, value: {} });\n var s = typeof e;\n if (s !== \"undefined\")\n if (s === \"string\")\n e !== \"\" && this._fromString(e);\n else if (e instanceof n) {\n var h = this;\n e.forEach(function(u, f) {\n h.append(f, u);\n });\n } else if (e !== null && s === \"object\")\n if (Object.prototype.toString.call(e) === \"[object Array]\")\n for (var t = 0; t < e.length; t++) {\n var y = e[t];\n if (Object.prototype.toString.call(y) === \"[object Array]\" || y.length !== 2)\n this.append(y[0], y[1]);\n else\n throw new TypeError(\"Expected [string, any] as entry at index \" + t + \" of URLSearchParams's input\");\n }\n else\n for (var r in e)\n e.hasOwnProperty(r) && this.append(r, e[r]);\n else\n throw new TypeError(\"Unsupported input's type for URLSearchParams\");\n }, o = n.prototype;\n o.append = function(e, s) {\n e in this._entries ? this._entries[e].push(String(s)) : this._entries[e] = [String(s)];\n }, o.delete = function(e) {\n delete this._entries[e];\n }, o.get = function(e) {\n return e in this._entries ? this._entries[e][0] : null;\n }, o.getAll = function(e) {\n return e in this._entries ? this._entries[e].slice(0) : [];\n }, o.has = function(e) {\n return e in this._entries;\n }, o.set = function(e, s) {\n this._entries[e] = [String(s)];\n }, o.forEach = function(e, s) {\n var h;\n for (var t in this._entries)\n if (this._entries.hasOwnProperty(t)) {\n h = this._entries[t];\n for (var y = 0; y < h.length; y++)\n e.call(s, h[y], t, this);\n }\n }, o.keys = function() {\n var e = [];\n return this.forEach(function(s, h) {\n e.push(h);\n }), v(e);\n }, o.values = function() {\n var e = [];\n return this.forEach(function(s) {\n e.push(s);\n }), v(e);\n }, o.entries = function() {\n var e = [];\n return this.forEach(function(s, h) {\n e.push([h, s]);\n }), v(e);\n }, d && (o[Symbol.iterator] = o.entries), o.toString = function() {\n var e = [];\n return this.forEach(function(s, h) {\n e.push(c(h) + \"=\" + c(s));\n }), e.join(\"&\");\n }, k.URLSearchParams = n;\n }, p = function() {\n try {\n var n = k.URLSearchParams;\n return new n(\"?a=1\").toString() === \"a=1\" && typeof n.prototype.set == \"function\";\n } catch {\n return !1;\n }\n };\n p() || a();\n var l = k.URLSearchParams.prototype;\n typeof l.sort != \"function\" && (l.sort = function() {\n var n = this, o = [];\n this.forEach(function(s, h) {\n o.push([h, s]), n._entries || n.delete(h);\n }), o.sort(function(s, h) {\n return s[0] < h[0] ? -1 : s[0] > h[0] ? 1 : 0;\n }), n._entries && (n._entries = {});\n for (var e = 0; e < o.length; e++)\n this.append(o[e][0], o[e][1]);\n }), typeof l._fromString != \"function\" && Object.defineProperty(l, \"_fromString\", {\n enumerable: !1,\n configurable: !1,\n writable: !1,\n value: function(n) {\n if (this._entries)\n this._entries = {};\n else {\n var o = [];\n this.forEach(function(t, y) {\n o.push(y);\n });\n for (var e = 0; e < o.length; e++)\n this.delete(o[e]);\n }\n n = n.replace(/^\\?/, \"\");\n for (var s = n.split(\"&\"), h, e = 0; e < s.length; e++)\n h = s[e].split(\"=\"), this.append(\n i(h[0]),\n h.length > 1 ? i(h[1]) : \"\"\n );\n }\n });\n})(\n typeof C < \"u\" ? C : typeof window < \"u\" ? window : typeof self < \"u\" ? self : C\n);\n(function(k) {\n var w = function() {\n try {\n var c = new k.URL(\"b\", \"http://a\");\n return c.pathname = \"c d\", c.href === \"http://a/c%20d\" && c.searchParams;\n } catch {\n return !1;\n }\n }, d = function() {\n var c = k.URL, i = function(l, n) {\n typeof l != \"string\" && (l = String(l));\n var o = document, e;\n if (n && (k.location === void 0 || n !== k.location.href)) {\n o = document.implementation.createHTMLDocument(\"\"), e = o.createElement(\"base\"), e.href = n, o.head.appendChild(e);\n try {\n if (e.href.indexOf(n) !== 0)\n throw new Error(e.href);\n } catch (m) {\n throw new Error(\"URL unable to set base \" + n + \" due to \" + m);\n }\n }\n var s = o.createElement(\"a\");\n s.href = l, e && (o.body.appendChild(s), s.href = s.href);\n var h = o.createElement(\"input\");\n if (h.type = \"url\", h.value = l, s.protocol === \":\" || !/:/.test(s.href) || !h.checkValidity() && !n)\n throw new TypeError(\"Invalid URL\");\n Object.defineProperty(this, \"_anchorElement\", {\n value: s\n });\n var t = new k.URLSearchParams(this.search), y = !0, r = !0, u = this;\n [\"append\", \"delete\", \"set\"].forEach(function(m) {\n var b = t[m];\n t[m] = function() {\n b.apply(t, arguments), y && (r = !1, u.search = t.toString(), r = !0);\n };\n }), Object.defineProperty(this, \"searchParams\", {\n value: t,\n enumerable: !0\n });\n var f = void 0;\n Object.defineProperty(this, \"_updateSearchParams\", {\n enumerable: !1,\n configurable: !1,\n writable: !1,\n value: function() {\n this.search !== f && (f = this.search, r && (y = !1, this.searchParams._fromString(this.search), y = !0));\n }\n });\n }, a = i.prototype, p = function(l) {\n Object.defineProperty(a, l, {\n get: function() {\n return this._anchorElement[l];\n },\n set: function(n) {\n this._anchorElement[l] = n;\n },\n enumerable: !0\n });\n };\n [\"hash\", \"host\", \"hostname\", \"port\", \"protocol\"].forEach(function(l) {\n p(l);\n }), Object.defineProperty(a, \"search\", {\n get: function() {\n return this._anchorElement.search;\n },\n set: function(l) {\n this._anchorElement.search = l, this._updateSearchParams();\n },\n enumerable: !0\n }), Object.defineProperties(a, {\n toString: {\n get: function() {\n var l = this;\n return function() {\n return l.href;\n };\n }\n },\n href: {\n get: function() {\n return this._anchorElement.href.replace(/\\?$/, \"\");\n },\n set: function(l) {\n this._anchorElement.href = l, this._updateSearchParams();\n },\n enumerable: !0\n },\n pathname: {\n get: function() {\n return this._anchorElement.pathname.replace(/(^\\/?)/, \"/\");\n },\n set: function(l) {\n this._anchorElement.pathname = l;\n },\n enumerable: !0\n },\n origin: {\n get: function() {\n var l = { \"http:\": 80, \"https:\": 443, \"ftp:\": 21 }[this._anchorElement.protocol], n = this._anchorElement.port != l && this._anchorElement.port !== \"\";\n return this._anchorElement.protocol + \"//\" + this._anchorElement.hostname + (n ? \":\" + this._anchorElement.port : \"\");\n },\n enumerable: !0\n },\n password: {\n // TODO\n get: function() {\n return \"\";\n },\n set: function(l) {\n },\n enumerable: !0\n },\n username: {\n // TODO\n get: function() {\n return \"\";\n },\n set: function(l) {\n },\n enumerable: !0\n }\n }), i.createObjectURL = function(l) {\n return c.createObjectURL.apply(c, arguments);\n }, i.revokeObjectURL = function(l) {\n return c.revokeObjectURL.apply(c, arguments);\n }, k.URL = i;\n };\n if (w() || d(), k.location !== void 0 && !(\"origin\" in k.location)) {\n var v = function() {\n return k.location.protocol + \"//\" + k.location.hostname + (k.location.port ? \":\" + k.location.port : \"\");\n };\n try {\n Object.defineProperty(k.location, \"origin\", {\n get: v,\n enumerable: !0\n });\n } catch {\n setInterval(function() {\n k.location.origin = v();\n }, 100);\n }\n }\n})(\n typeof C < \"u\" ? C : typeof window < \"u\" ? window : typeof self < \"u\" ? self : C\n);\nvar j = { exports: {} };\n(function(k, w) {\n (function(d, v) {\n k.exports = v();\n })(window, function() {\n return function(d) {\n var v = {};\n function c(i) {\n if (v[i])\n return v[i].exports;\n var a = v[i] = { i, l: !1, exports: {} };\n return d[i].call(a.exports, a, a.exports, c), a.l = !0, a.exports;\n }\n return c.m = d, c.c = v, c.d = function(i, a, p) {\n c.o(i, a) || Object.defineProperty(i, a, { enumerable: !0, get: p });\n }, c.r = function(i) {\n typeof Symbol < \"u\" && Symbol.toStringTag && Object.defineProperty(i, Symbol.toStringTag, { value: \"Module\" }), Object.defineProperty(i, \"__esModule\", { value: !0 });\n }, c.t = function(i, a) {\n if (1 & a && (i = c(i)), 8 & a || 4 & a && typeof i == \"object\" && i && i.__esModule)\n return i;\n var p = /* @__PURE__ */ Object.create(null);\n if (c.r(p), Object.defineProperty(p, \"default\", { enumerable: !0, value: i }), 2 & a && typeof i != \"string\")\n for (var l in i)\n c.d(p, l, (function(n) {\n return i[n];\n }).bind(null, l));\n return p;\n }, c.n = function(i) {\n var a = i && i.__esModule ? function() {\n return i.default;\n } : function() {\n return i;\n };\n return c.d(a, \"a\", a), a;\n }, c.o = function(i, a) {\n return Object.prototype.hasOwnProperty.call(i, a);\n }, c.p = \"\", c(c.s = 3);\n }([function(d, v) {\n var c;\n c = function() {\n return this;\n }();\n try {\n c = c || new Function(\"return this\")();\n } catch {\n typeof window == \"object\" && (c = window);\n }\n d.exports = c;\n }, function(d, v, c) {\n (function(i) {\n var a = c(2), p = setTimeout;\n function l() {\n }\n function n(r) {\n if (!(this instanceof n))\n throw new TypeError(\"Promises must be constructed via new\");\n if (typeof r != \"function\")\n throw new TypeError(\"not a function\");\n this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], y(r, this);\n }\n function o(r, u) {\n for (; r._state === 3; )\n r = r._value;\n r._state !== 0 ? (r._handled = !0, n._immediateFn(function() {\n var f = r._state === 1 ? u.onFulfilled : u.onRejected;\n if (f !== null) {\n var m;\n try {\n m = f(r._value);\n } catch (b) {\n return void s(u.promise, b);\n }\n e(u.promise, m);\n } else\n (r._state === 1 ? e : s)(u.promise, r._value);\n })) : r._deferreds.push(u);\n }\n function e(r, u) {\n try {\n if (u === r)\n throw new TypeError(\"A promise cannot be resolved with itself.\");\n if (u && (typeof u == \"object\" || typeof u == \"function\")) {\n var f = u.then;\n if (u instanceof n)\n return r._state = 3, r._value = u, void h(r);\n if (typeof f == \"function\")\n return void y((m = f, b = u, function() {\n m.apply(b, arguments);\n }), r);\n }\n r._state = 1, r._value = u, h(r);\n } catch (g) {\n s(r, g);\n }\n var m, b;\n }\n function s(r, u) {\n r._state = 2, r._value = u, h(r);\n }\n function h(r) {\n r._state === 2 && r._deferreds.length === 0 && n._immediateFn(function() {\n r._handled || n._unhandledRejectionFn(r._value);\n });\n for (var u = 0, f = r._deferreds.length; u < f; u++)\n o(r, r._deferreds[u]);\n r._deferreds = null;\n }\n function t(r, u, f) {\n this.onFulfilled = typeof r == \"function\" ? r : null, this.onRejected = typeof u == \"function\" ? u : null, this.promise = f;\n }\n function y(r, u) {\n var f = !1;\n try {\n r(function(m) {\n f || (f = !0, e(u, m));\n }, function(m) {\n f || (f = !0, s(u, m));\n });\n } catch (m) {\n if (f)\n return;\n f = !0, s(u, m);\n }\n }\n n.prototype.catch = function(r) {\n return this.then(null, r);\n }, n.prototype.then = function(r, u) {\n var f = new this.constructor(l);\n return o(this, new t(r, u, f)), f;\n }, n.prototype.finally = a.a, n.all = function(r) {\n return new n(function(u, f) {\n if (!r || r.length === void 0)\n throw new TypeError(\"Promise.all accepts an array\");\n var m = Array.prototype.slice.call(r);\n if (m.length === 0)\n return u([]);\n var b = m.length;\n function g(T, E) {\n try {\n if (E && (typeof E == \"object\" || typeof E == \"function\")) {\n var S = E.then;\n if (typeof S == \"function\")\n return void S.call(E, function(L) {\n g(T, L);\n }, f);\n }\n m[T] = E, --b == 0 && u(m);\n } catch (L) {\n f(L);\n }\n }\n for (var _ = 0; _ < m.length; _++)\n g(_, m[_]);\n });\n }, n.resolve = function(r) {\n return r && typeof r == \"object\" && r.constructor === n ? r : new n(function(u) {\n u(r);\n });\n }, n.reject = function(r) {\n return new n(function(u, f) {\n f(r);\n });\n }, n.race = function(r) {\n return new n(function(u, f) {\n for (var m = 0, b = r.length; m < b; m++)\n r[m].then(u, f);\n });\n }, n._immediateFn = typeof i == \"function\" && function(r) {\n i(r);\n } || function(r) {\n p(r, 0);\n }, n._unhandledRejectionFn = function(r) {\n typeof console < \"u\" && console && console.warn(\"Possible Unhandled Promise Rejection:\", r);\n }, v.a = n;\n }).call(this, c(5).setImmediate);\n }, function(d, v, c) {\n v.a = function(i) {\n var a = this.constructor;\n return this.then(function(p) {\n return a.resolve(i()).then(function() {\n return p;\n });\n }, function(p) {\n return a.resolve(i()).then(function() {\n return a.reject(p);\n });\n });\n };\n }, function(d, v, c) {\n function i(t) {\n return (i = typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" ? function(y) {\n return typeof y;\n } : function(y) {\n return y && typeof Symbol == \"function\" && y.constructor === Symbol && y !== Symbol.prototype ? \"symbol\" : typeof y;\n })(t);\n }\n c(4);\n var a, p, l, n, o, e, s = c(8), h = (p = function(t) {\n return new Promise(function(y, r) {\n t = n(t), t = o(t);\n var u = window.XMLHttpRequest ? new window.XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n u.open(t.method, t.url), u.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\"), Object.keys(t.headers).forEach(function(m) {\n var b = t.headers[m];\n u.setRequestHeader(m, b);\n });\n var f = t.ratio;\n u.upload.addEventListener(\"progress\", function(m) {\n var b = Math.round(m.loaded / m.total * 100), g = Math.ceil(b * f / 100);\n t.progress(g);\n }, !1), u.addEventListener(\"progress\", function(m) {\n var b = Math.round(m.loaded / m.total * 100), g = Math.ceil(b * (100 - f) / 100) + f;\n t.progress(g);\n }, !1), u.onreadystatechange = function() {\n if (u.readyState === 4) {\n var m = u.response;\n try {\n m = JSON.parse(m);\n } catch {\n }\n var b = s.parseHeaders(u.getAllResponseHeaders()), g = { body: m, code: u.status, headers: b };\n u.status === 200 ? y(g) : r(g);\n }\n }, u.send(t.data);\n });\n }, l = function(t) {\n return t.method = \"POST\", p(t);\n }, n = function() {\n var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n if (t.url && typeof t.url != \"string\")\n throw new Error(\"Url must be a string\");\n if (t.url = t.url || \"\", t.method && typeof t.method != \"string\")\n throw new Error(\"`method` must be a string or null\");\n if (t.method = t.method ? t.method.toUpperCase() : \"GET\", t.headers && i(t.headers) !== \"object\")\n throw new Error(\"`headers` must be an object or null\");\n if (t.headers = t.headers || {}, t.type && (typeof t.type != \"string\" || !Object.values(a).includes(t.type)))\n throw new Error(\"`type` must be taken from module's \u00ABcontentType\u00BB library\");\n if (t.progress && typeof t.progress != \"function\")\n throw new Error(\"`progress` must be a function or null\");\n if (t.progress = t.progress || function(y) {\n }, t.beforeSend = t.beforeSend || function(y) {\n }, t.ratio && typeof t.ratio != \"number\")\n throw new Error(\"`ratio` must be a number\");\n if (t.ratio < 0 || t.ratio > 100)\n throw new Error(\"`ratio` must be in a 0-100 interval\");\n if (t.ratio = t.ratio || 90, t.accept && typeof t.accept != \"string\")\n throw new Error(\"`accept` must be a string with a list of allowed mime-types\");\n if (t.accept = t.accept || \"*/*\", t.multiple && typeof t.multiple != \"boolean\")\n throw new Error(\"`multiple` must be a true or false\");\n if (t.multiple = t.multiple || !1, t.fieldName && typeof t.fieldName != \"string\")\n throw new Error(\"`fieldName` must be a string\");\n return t.fieldName = t.fieldName || \"files\", t;\n }, o = function(t) {\n switch (t.method) {\n case \"GET\":\n var y = e(t.data, a.URLENCODED);\n delete t.data, t.url = /\\?/.test(t.url) ? t.url + \"&\" + y : t.url + \"?\" + y;\n break;\n case \"POST\":\n case \"PUT\":\n case \"DELETE\":\n case \"UPDATE\":\n var r = function() {\n return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}).type || a.JSON;\n }(t);\n (s.isFormData(t.data) || s.isFormElement(t.data)) && (r = a.FORM), t.data = e(t.data, r), r !== h.contentType.FORM && (t.headers[\"content-type\"] = r);\n }\n return t;\n }, e = function() {\n var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n switch (arguments.length > 1 ? arguments[1] : void 0) {\n case a.URLENCODED:\n return s.urlEncode(t);\n case a.JSON:\n return s.jsonEncode(t);\n case a.FORM:\n return s.formEncode(t);\n default:\n return t;\n }\n }, { contentType: a = { URLENCODED: \"application/x-www-form-urlencoded; charset=utf-8\", FORM: \"multipart/form-data\", JSON: \"application/json; charset=utf-8\" }, request: p, get: function(t) {\n return t.method = \"GET\", p(t);\n }, post: l, transport: function(t) {\n return t = n(t), s.selectFiles(t).then(function(y) {\n for (var r = new FormData(), u = 0; u < y.length; u++)\n r.append(t.fieldName, y[u], y[u].name);\n return s.isObject(t.data) && Object.keys(t.data).forEach(function(f) {\n var m = t.data[f];\n r.append(f, m);\n }), t.beforeSend && t.beforeSend(y), t.data = r, l(t);\n });\n }, selectFiles: function(t) {\n return delete (t = n(t)).beforeSend, s.selectFiles(t);\n } });\n d.exports = h;\n }, function(d, v, c) {\n c.r(v);\n var i = c(1);\n window.Promise = window.Promise || i.a;\n }, function(d, v, c) {\n (function(i) {\n var a = i !== void 0 && i || typeof self < \"u\" && self || window, p = Function.prototype.apply;\n function l(n, o) {\n this._id = n, this._clearFn = o;\n }\n v.setTimeout = function() {\n return new l(p.call(setTimeout, a, arguments), clearTimeout);\n }, v.setInterval = function() {\n return new l(p.call(setInterval, a, arguments), clearInterval);\n }, v.clearTimeout = v.clearInterval = function(n) {\n n && n.close();\n }, l.prototype.unref = l.prototype.ref = function() {\n }, l.prototype.close = function() {\n this._clearFn.call(a, this._id);\n }, v.enroll = function(n, o) {\n clearTimeout(n._idleTimeoutId), n._idleTimeout = o;\n }, v.unenroll = function(n) {\n clearTimeout(n._idleTimeoutId), n._idleTimeout = -1;\n }, v._unrefActive = v.active = function(n) {\n clearTimeout(n._idleTimeoutId);\n var o = n._idleTimeout;\n o >= 0 && (n._idleTimeoutId = setTimeout(function() {\n n._onTimeout && n._onTimeout();\n }, o));\n }, c(6), v.setImmediate = typeof self < \"u\" && self.setImmediate || i !== void 0 && i.setImmediate || this && this.setImmediate, v.clearImmediate = typeof self < \"u\" && self.clearImmediate || i !== void 0 && i.clearImmediate || this && this.clearImmediate;\n }).call(this, c(0));\n }, function(d, v, c) {\n (function(i, a) {\n (function(p, l) {\n if (!p.setImmediate) {\n var n, o, e, s, h, t = 1, y = {}, r = !1, u = p.document, f = Object.getPrototypeOf && Object.getPrototypeOf(p);\n f = f && f.setTimeout ? f : p, {}.toString.call(p.process) === \"[object process]\" ? n = function(g) {\n a.nextTick(function() {\n b(g);\n });\n } : function() {\n if (p.postMessage && !p.importScripts) {\n var g = !0, _ = p.onmessage;\n return p.onmessage = function() {\n g = !1;\n }, p.postMessage(\"\", \"*\"), p.onmessage = _, g;\n }\n }() ? (s = \"setImmediate$\" + Math.random() + \"$\", h = function(g) {\n g.source === p && typeof g.data == \"string\" && g.data.indexOf(s) === 0 && b(+g.data.slice(s.length));\n }, p.addEventListener ? p.addEventListener(\"message\", h, !1) : p.attachEvent(\"onmessage\", h), n = function(g) {\n p.postMessage(s + g, \"*\");\n }) : p.MessageChannel ? ((e = new MessageChannel()).port1.onmessage = function(g) {\n b(g.data);\n }, n = function(g) {\n e.port2.postMessage(g);\n }) : u && \"onreadystatechange\" in u.createElement(\"script\") ? (o = u.documentElement, n = function(g) {\n var _ = u.createElement(\"script\");\n _.onreadystatechange = function() {\n b(g), _.onreadystatechange = null, o.removeChild(_), _ = null;\n }, o.appendChild(_);\n }) : n = function(g) {\n setTimeout(b, 0, g);\n }, f.setImmediate = function(g) {\n typeof g != \"function\" && (g = new Function(\"\" + g));\n for (var _ = new Array(arguments.length - 1), T = 0; T < _.length; T++)\n _[T] = arguments[T + 1];\n var E = { callback: g, args: _ };\n return y[t] = E, n(t), t++;\n }, f.clearImmediate = m;\n }\n function m(g) {\n delete y[g];\n }\n function b(g) {\n if (r)\n setTimeout(b, 0, g);\n else {\n var _ = y[g];\n if (_) {\n r = !0;\n try {\n (function(T) {\n var E = T.callback, S = T.args;\n switch (S.length) {\n case 0:\n E();\n break;\n case 1:\n E(S[0]);\n break;\n case 2:\n E(S[0], S[1]);\n break;\n case 3:\n E(S[0], S[1], S[2]);\n break;\n default:\n E.apply(l, S);\n }\n })(_);\n } finally {\n m(g), r = !1;\n }\n }\n }\n }\n })(typeof self > \"u\" ? i === void 0 ? this : i : self);\n }).call(this, c(0), c(7));\n }, function(d, v) {\n var c, i, a = d.exports = {};\n function p() {\n throw new Error(\"setTimeout has not been defined\");\n }\n function l() {\n throw new Error(\"clearTimeout has not been defined\");\n }\n function n(f) {\n if (c === setTimeout)\n return setTimeout(f, 0);\n if ((c === p || !c) && setTimeout)\n return c = setTimeout, setTimeout(f, 0);\n try {\n return c(f, 0);\n } catch {\n try {\n return c.call(null, f, 0);\n } catch {\n return c.call(this, f, 0);\n }\n }\n }\n (function() {\n try {\n c = typeof setTimeout == \"function\" ? setTimeout : p;\n } catch {\n c = p;\n }\n try {\n i = typeof clearTimeout == \"function\" ? clearTimeout : l;\n } catch {\n i = l;\n }\n })();\n var o, e = [], s = !1, h = -1;\n function t() {\n s && o && (s = !1, o.length ? e = o.concat(e) : h = -1, e.length && y());\n }\n function y() {\n if (!s) {\n var f = n(t);\n s = !0;\n for (var m = e.length; m; ) {\n for (o = e, e = []; ++h < m; )\n o && o[h].run();\n h = -1, m = e.length;\n }\n o = null, s = !1, function(b) {\n if (i === clearTimeout)\n return clearTimeout(b);\n if ((i === l || !i) && clearTimeout)\n return i = clearTimeout, clearTimeout(b);\n try {\n i(b);\n } catch {\n try {\n return i.call(null, b);\n } catch {\n return i.call(this, b);\n }\n }\n }(f);\n }\n }\n function r(f, m) {\n this.fun = f, this.array = m;\n }\n function u() {\n }\n a.nextTick = function(f) {\n var m = new Array(arguments.length - 1);\n if (arguments.length > 1)\n for (var b = 1; b < arguments.length; b++)\n m[b - 1] = arguments[b];\n e.push(new r(f, m)), e.length !== 1 || s || n(y);\n }, r.prototype.run = function() {\n this.fun.apply(null, this.array);\n }, a.title = \"browser\", a.browser = !0, a.env = {}, a.argv = [], a.version = \"\", a.versions = {}, a.on = u, a.addListener = u, a.once = u, a.off = u, a.removeListener = u, a.removeAllListeners = u, a.emit = u, a.prependListener = u, a.prependOnceListener = u, a.listeners = function(f) {\n return [];\n }, a.binding = function(f) {\n throw new Error(\"process.binding is not supported\");\n }, a.cwd = function() {\n return \"/\";\n }, a.chdir = function(f) {\n throw new Error(\"process.chdir is not supported\");\n }, a.umask = function() {\n return 0;\n };\n }, function(d, v, c) {\n function i(p, l) {\n for (var n = 0; n < l.length; n++) {\n var o = l[n];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(p, o.key, o);\n }\n }\n var a = c(9);\n d.exports = function() {\n function p() {\n (function(e, s) {\n if (!(e instanceof s))\n throw new TypeError(\"Cannot call a class as a function\");\n })(this, p);\n }\n var l, n, o;\n return l = p, o = [{ key: \"urlEncode\", value: function(e) {\n return a(e);\n } }, { key: \"jsonEncode\", value: function(e) {\n return JSON.stringify(e);\n } }, { key: \"formEncode\", value: function(e) {\n if (this.isFormData(e))\n return e;\n if (this.isFormElement(e))\n return new FormData(e);\n if (this.isObject(e)) {\n var s = new FormData();\n return Object.keys(e).forEach(function(h) {\n var t = e[h];\n s.append(h, t);\n }), s;\n }\n throw new Error(\"`data` must be an instance of Object, FormData or <FORM> HTMLElement\");\n } }, { key: \"isObject\", value: function(e) {\n return Object.prototype.toString.call(e) === \"[object Object]\";\n } }, { key: \"isFormData\", value: function(e) {\n return e instanceof FormData;\n } }, { key: \"isFormElement\", value: function(e) {\n return e instanceof HTMLFormElement;\n } }, { key: \"selectFiles\", value: function() {\n var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n return new Promise(function(s, h) {\n var t = document.createElement(\"INPUT\");\n t.type = \"file\", e.multiple && t.setAttribute(\"multiple\", \"multiple\"), e.accept && t.setAttribute(\"accept\", e.accept), t.style.display = \"none\", document.body.appendChild(t), t.addEventListener(\"change\", function(y) {\n var r = y.target.files;\n s(r), document.body.removeChild(t);\n }, !1), t.click();\n });\n } }, { key: \"parseHeaders\", value: function(e) {\n var s = e.trim().split(/[\\r\\n]+/), h = {};\n return s.forEach(function(t) {\n var y = t.split(\": \"), r = y.shift(), u = y.join(\": \");\n r && (h[r] = u);\n }), h;\n } }], (n = null) && i(l.prototype, n), o && i(l, o), p;\n }();\n }, function(d, v) {\n var c = function(a) {\n return encodeURIComponent(a).replace(/[!'()*]/g, escape).replace(/%20/g, \"+\");\n }, i = function(a, p, l, n) {\n return p = p || null, l = l || \"&\", n = n || null, a ? function(o) {\n for (var e = new Array(), s = 0; s < o.length; s++)\n o[s] && e.push(o[s]);\n return e;\n }(Object.keys(a).map(function(o) {\n var e, s, h = o;\n if (n && (h = n + \"[\" + h + \"]\"), typeof a[o] == \"object\" && a[o] !== null)\n e = i(a[o], null, l, h);\n else {\n p && (s = h, h = !isNaN(parseFloat(s)) && isFinite(s) ? p + Number(h) : h);\n var t = a[o];\n t = (t = (t = (t = t === !0 ? \"1\" : t) === !1 ? \"0\" : t) === 0 ? \"0\" : t) || \"\", e = c(h) + \"=\" + c(t);\n }\n return e;\n })).join(l).replace(/[!'()*]/g, \"\") : \"\";\n };\n d.exports = i;\n }]);\n });\n})(j);\nvar P = j.exports;\nconst R = /* @__PURE__ */ O(P), F = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M7.69998 12.6L7.67896 12.62C6.53993 13.7048 6.52012 15.5155 7.63516 16.625V16.625C8.72293 17.7073 10.4799 17.7102 11.5712 16.6314L13.0263 15.193C14.0703 14.1609 14.2141 12.525 13.3662 11.3266L13.22 11.12\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M16.22 11.12L16.3564 10.9805C17.2895 10.0265 17.3478 8.5207 16.4914 7.49733V7.49733C15.569 6.39509 13.9269 6.25143 12.8271 7.17675L11.39 8.38588C10.0935 9.47674 9.95704 11.4241 11.0887 12.6852L11.12 12.72\"/></svg>';\nclass I {\n /**\n * Notify core that read-only mode supported\n *\n * @returns {boolean}\n */\n static get isReadOnlySupported() {\n return !0;\n }\n /**\n * Get Tool toolbox settings\n * icon - Tool icon's SVG\n * title - title to show in toolbox\n *\n * @returns {{icon: string, title: string}}\n */\n static get toolbox() {\n return {\n icon: F,\n title: \"Link\"\n };\n }\n /**\n * Allow to press Enter inside the LinkTool input\n *\n * @returns {boolean}\n * @public\n */\n static get enableLineBreaks() {\n return !0;\n }\n /**\n * @param {object} options - Tool constructor options fot from Editor.js\n * @param {LinkToolData} options.data - previously saved data\n * @param {LinkToolConfig} options.config - user config for Tool\n * @param {object} options.api - Editor.js API\n * @param {boolean} options.readOnly - read-only mode flag\n */\n constructor({ data: w, config: d, api: v, readOnly: c }) {\n this.api = v, this.readOnly = c, this.config = {\n endpoint: d.endpoint || \"\",\n headers: d.headers || {}\n }, this.nodes = {\n wrapper: null,\n container: null,\n progress: null,\n input: null,\n inputHolder: null,\n linkContent: null,\n linkImage: null,\n linkTitle: null,\n linkDescription: null,\n linkText: null\n }, this._data = {\n link: \"\",\n meta: {}\n }, this.data = w;\n }\n /**\n * Renders Block content\n *\n * @public\n *\n * @returns {HTMLDivElement}\n */\n render() {\n return this.nodes.wrapper = this.make(\"div\", this.CSS.baseClass), this.nodes.container = this.make(\"div\", this.CSS.container), this.nodes.inputHolder = this.makeInputHolder(), this.nodes.linkContent = this.prepareLinkPreview(), Object.keys(this.data.meta).length ? (this.nodes.container.appendChild(this.nodes.linkContent), this.showLinkPreview(this.data.meta)) : this.nodes.container.appendChild(this.nodes.inputHolder), this.nodes.wrapper.appendChild(this.nodes.container), this.nodes.wrapper;\n }\n /**\n * Return Block data\n *\n * @public\n *\n * @returns {LinkToolData}\n */\n save() {\n return this.data;\n }\n /**\n * Validate Block data\n * - check if given link is an empty string or not.\n *\n * @public\n *\n * @returns {boolean} false if saved data is incorrect, otherwise true\n */\n validate() {\n return this.data.link.trim() !== \"\";\n }\n /**\n * Stores all Tool's data\n *\n * @param {LinkToolData} data - data to store\n */\n set data(w) {\n this._data = Object.assign({}, {\n link: w.link || this._data.link,\n meta: w.meta || this._data.meta\n });\n }\n /**\n * Return Tool data\n *\n * @returns {LinkToolData}\n */\n get data() {\n return this._data;\n }\n /**\n * @returns {object} - Link Tool styles\n */\n get CSS() {\n return {\n baseClass: this.api.styles.block,\n input: this.api.styles.input,\n /**\n * Tool's classes\n */\n container: \"link-tool\",\n inputEl: \"link-tool__input\",\n inputHolder: \"link-tool__input-holder\",\n inputError: \"link-tool__input-holder--error\",\n linkContent: \"link-tool__content\",\n linkContentRendered: \"link-tool__content--rendered\",\n linkImage: \"link-tool__image\",\n linkTitle: \"link-tool__title\",\n linkDescription: \"link-tool__description\",\n linkText: \"link-tool__anchor\",\n progress: \"link-tool__progress\",\n progressLoading: \"link-tool__progress--loading\",\n progressLoaded: \"link-tool__progress--loaded\"\n };\n }\n /**\n * Prepare input holder\n *\n * @returns {HTMLElement}\n */\n makeInputHolder() {\n const w = this.make(\"div\", this.CSS.inputHolder);\n return this.nodes.progress = this.make(\"label\", this.CSS.progress), this.nodes.input = this.make(\"div\", [this.CSS.input, this.CSS.inputEl], {\n contentEditable: !this.readOnly\n }), this.nodes.input.dataset.placeholder = this.api.i18n.t(\"Link\"), this.readOnly || (this.nodes.input.addEventListener(\"paste\", (d) => {\n this.startFetching(d);\n }), this.nodes.input.addEventListener(\"keydown\", (d) => {\n const [v, c] = [13, 65], i = d.ctrlKey || d.metaKey;\n switch (d.keyCode) {\n case v:\n d.preventDefault(), d.stopPropagation(), this.startFetching(d);\n break;\n case c:\n i && this.selectLinkUrl(d);\n break;\n }\n })), w.appendChild(this.nodes.progress), w.appendChild(this.nodes.input), w;\n }\n /**\n * Activates link data fetching by url\n *\n * @param {PasteEvent|KeyboardEvent} event - fetching could be fired by a pase or keydown events\n */\n startFetching(w) {\n let d = this.nodes.input.textContent;\n w.type === \"paste\" && (d = (w.clipboardData || window.clipboardData).getData(\"text\")), this.removeErrorStyle(), this.fetchLinkData(d);\n }\n /**\n * If previous link data fetching failed, remove error styles\n */\n removeErrorStyle() {\n this.nodes.inputHolder.classList.remove(this.CSS.inputError), this.nodes.inputHolder.insertBefore(this.nodes.progress, this.nodes.input);\n }\n /**\n * Select LinkTool input content by CMD+A\n *\n * @param {KeyboardEvent} event - keydown\n */\n selectLinkUrl(w) {\n w.preventDefault(), w.stopPropagation();\n const d = window.getSelection(), v = new Range(), a = d.anchorNode.parentNode.closest(`.${this.CSS.inputHolder}`).querySelector(`.${this.CSS.inputEl}`);\n v.selectNodeContents(a), d.removeAllRanges(), d.addRange(v);\n }\n /**\n * Prepare link preview holder\n *\n * @returns {HTMLElement}\n */\n prepareLinkPreview() {\n const w = this.make(\"a\", this.CSS.linkContent, {\n target: \"_blank\",\n rel: \"nofollow noindex noreferrer\"\n });\n return this.nodes.linkImage = this.make(\"div\", this.CSS.linkImage), this.nodes.linkTitle = this.make(\"div\", this.CSS.linkTitle), this.nodes.linkDescription = this.make(\"p\", this.CSS.linkDescription), this.nodes.linkText = this.make(\"span\", this.CSS.linkText), w;\n }\n /**\n * Compose link preview from fetched data\n *\n * @param {metaData} meta - link meta data\n */\n showLinkPreview({ image: w, title: d, description: v }) {\n this.nodes.container.appendChild(this.nodes.linkContent), w && w.url && (this.nodes.linkImage.style.backgroundImage = \"url(\" + w.url + \")\", this.nodes.linkContent.appendChild(this.nodes.linkImage)), d && (this.nodes.linkTitle.textContent = d, this.nodes.linkContent.appendChild(this.nodes.linkTitle)), v && (this.nodes.linkDescription.textContent = v, this.nodes.linkContent.appendChild(this.nodes.linkDescription)), this.nodes.linkContent.classList.add(this.CSS.linkContentRendered), this.nodes.linkContent.setAttribute(\"href\", this.data.link), this.nodes.linkContent.appendChild(this.nodes.linkText);\n try {\n this.nodes.linkText.textContent = new URL(this.data.link).hostname;\n } catch {\n this.nodes.linkText.textContent = this.data.link;\n }\n }\n /**\n * Show loading progress bar\n */\n showProgress() {\n this.nodes.progress.classList.add(this.CSS.progressLoading);\n }\n /**\n * Hide loading progress bar\n *\n * @returns {Promise<void>}\n */\n hideProgress() {\n return new Promise((w) => {\n this.nodes.progress.classList.remove(this.CSS.progressLoading), this.nodes.progress.classList.add(this.CSS.progressLoaded), setTimeout(w, 500);\n });\n }\n /**\n * If data fetching failed, set input error style\n */\n applyErrorStyle() {\n this.nodes.inputHolder.classList.add(this.CSS.inputError), this.nodes.progress.remove();\n }\n /**\n * Sends to backend pasted url and receives link data\n *\n * @param {string} url - link source url\n */\n async fetchLinkData(w) {\n this.showProgress(), this.data = { link: w };\n try {\n const { body: d } = await R.get({\n url: this.config.endpoint,\n headers: this.config.headers,\n data: {\n url: w\n }\n });\n this.onFetch(d);\n } catch {\n this.fetchingFailed(this.api.i18n.t(\"Couldn't fetch the link data\"));\n }\n }\n /**\n * Link data fetching callback\n *\n * @param {UploadResponseFormat} response - backend response\n */\n onFetch(w) {\n if (!w || !w.success) {\n this.fetchingFailed(this.api.i18n.t(\"Couldn't get this link data, try the other one\"));\n return;\n }\n const d = w.meta, v = w.link || this.data.link;\n if (this.data = {\n meta: d,\n link: v\n }, !d) {\n this.fetchingFailed(this.api.i18n.t(\"Wrong response format from the server\"));\n return;\n }\n this.hideProgress().then(() => {\n this.nodes.inputHolder.remove(), this.showLinkPreview(d);\n });\n }\n /**\n * Handle link fetching errors\n *\n * @private\n *\n * @param {string} errorMessage - message to explain user what he should do\n */\n fetchingFailed(w) {\n this.api.notifier.show({\n message: w,\n style: \"error\"\n }), this.applyErrorStyle();\n }\n /**\n * Helper method for elements creation\n *\n * @param {string} tagName - name of creating element\n * @param {string|string[]} [classNames] - list of CSS classes to add\n * @param {object} [attributes] - object with attributes to add\n * @returns {HTMLElement}\n */\n make(w, d = null, v = {}) {\n const c = document.createElement(w);\n Array.isArray(d) ? c.classList.add(...d) : d && c.classList.add(d);\n for (const i in v)\n c[i] = v[i];\n return c;\n }\n}\nexport {\n I as default\n};\n", "import { Controller } from '@hotwired/stimulus'\nimport EditorJS, { API, BlockMutationEvent } from '@editorjs/editorjs'\nimport Header from '@editorjs/header'\nimport List from '@editorjs/list'\nimport Quote from '@editorjs/quote'\nimport ImageTool from '@editorjs/image'\nimport Embed from '@editorjs/embed'\nimport Table from '@editorjs/table'\nimport Underline from '@editorjs/underline'\nimport LinkTool from '@editorjs/link'\n\nexport class EditorController extends Controller<HTMLInputElement> {\n container?: HTMLDivElement\n contentEditor?: EditorJS\n\n connect(): void {\n this.container = this.createContainer()\n this.element.insertAdjacentElement('afterend', this.container)\n this.contentEditor = new EditorJS({\n holder: this.container,\n data: this.getInitialData(),\n placeholder: 'Type your article here...',\n tools: {\n header: {\n class: Header,\n config: {\n levels: [2, 3, 4, 5, 6],\n },\n },\n list: List,\n quote: Quote,\n embed: Embed,\n table: {\n class: Table,\n config: {\n withHeadings: true,\n },\n },\n underline: Underline,\n image: {\n class: ImageTool,\n config: {\n endpoints: {\n byFile: `/articles/images`,\n },\n types: 'image/png, image/jpg, image/jpeg, image/webp',\n additionalRequestHeaders: {\n 'X-CSRF-Token': this.csrfToken,\n },\n },\n },\n link: {\n class: LinkTool,\n config: {\n endpoint: `/i/url-preview`,\n },\n },\n },\n onChange: this.onChangeEditor,\n })\n this.setupListener()\n }\n\n disconnect(): void {\n this.removeListener()\n this.contentEditor?.destroy()\n this.container?.remove()\n }\n\n get csrfToken() {\n const metaTag: HTMLMetaElement | null = document.querySelector(\n 'meta[name=\"csrf-token\"]'\n )\n return metaTag?.content\n }\n\n private onChangeEditor = async (api: API) => {\n const data = await api.saver.save()\n console.log('data', data)\n this.element.value = JSON.stringify(data)\n }\n\n private setupListener() {\n this.element.form?.addEventListener('submit', this.saveEditorData)\n }\n\n private removeListener() {\n this.element.form?.removeEventListener('submit', this.saveEditorData)\n }\n\n private saveEditorData = async (event: SubmitEvent) => {\n event.preventDefault()\n const data = await this.contentEditor?.save()\n this.element.value = JSON.stringify(data)\n this.element.form?.submit()\n }\n\n private getInitialData() {\n const value = this.element.value\n return value ? JSON.parse(value) : {}\n }\n\n private createContainer() {\n const container = document.createElement('div')\n container.classList.add('editor-canvas')\n\n return container\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { DirectUpload } from '@rails/activestorage'\n\nexport class ArticleFormController extends Controller {\n static targets = [\n 'changeCoverImageButton',\n 'contentInput',\n 'coverImageInput',\n 'coverImagePreview',\n 'dropzone',\n 'removeCoverImageButton',\n 'saveButton',\n 'titleEditor',\n 'titleInput',\n ]\n\n declare changeCoverImageButton: HTMLButtonElement\n declare removeCoverImageButton: HTMLButtonElement\n declare coverImageInputTarget: HTMLInputElement\n declare coverImagePreviewTarget: HTMLImageElement\n declare dropzoneTarget: HTMLDivElement\n declare saveButtonTarget: HTMLButtonElement\n declare titleEditorTarget: HTMLDivElement\n declare titleInputTarget: HTMLInputElement\n declare contentInputTarget: HTMLInputElement\n declare hasChangeCoverImageTarget: boolean\n declare hasRemoveCoverImageTarget: boolean\n declare hasCoverImageInputTarget: boolean\n declare hasCoverImagePreviewTarget: boolean\n declare hasDropzoneTarget: boolean\n declare hasTitleEditorTarget: boolean\n declare hasTitleInputTarget: boolean\n declare hasContentInputTarget: boolean\n\n connect(): void {\n this.setupListeners()\n }\n\n disconnect(): void {\n this.removeListeners()\n }\n\n removeCoverImage = (): void => {\n this.coverImageInputTarget.value = ''\n this.coverImagePreviewTarget.src = ''\n\n document\n .querySelectorAll(\n `input[name=\"${this.coverImageInputTarget.name}\"][type=\"hidden\"]`\n )\n .forEach(el => el.remove())\n }\n\n changeCoverImage = (): void => {\n this.coverImageInputTarget.click()\n }\n\n private setupListeners() {\n this.dropzoneTarget.addEventListener('dragenter', this.onDragOver, false)\n this.dropzoneTarget.addEventListener('dragover', this.onDragOver, false)\n this.dropzoneTarget.addEventListener('dragleave', this.onDrop, false)\n this.dropzoneTarget.addEventListener('drop', this.onDrop, false)\n }\n\n private removeListeners() {\n this.dropzoneTarget.removeEventListener('dragenter', this.onDragOver)\n this.dropzoneTarget.removeEventListener('dragover', this.onDragOver)\n this.dropzoneTarget.removeEventListener('dragleave', this.onDrop)\n this.dropzoneTarget.removeEventListener('drop', this.onDrop)\n }\n\n onTitleInput = () => {\n const content = this.titleEditorTarget.textContent || ''\n\n if (!content.trim().length) {\n this.titleEditorTarget.innerHTML = ''\n }\n\n this.titleInputTarget.value = content\n }\n\n onTitleKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Enter') {\n event.preventDefault()\n }\n }\n\n onCoverImageChange = (_event: Event): void => {\n const file = this.coverImageInputTarget.files?.item(0)\n if (!file) return\n\n const sizeInMB = file.size / 1024 / 1024\n if (sizeInMB > 5) return alert('File is too big')\n\n this.previewFile(file)\n this.uploadFile(file)\n }\n\n private onDragOver = (_event: DragEvent): void => {\n this.dropzoneTarget.classList.add('border-primary-500')\n this.dropzoneTarget.classList.remove(\n 'border-gray-900/25',\n 'dark:border-neutral-600'\n )\n }\n\n private onDrop = (event: DragEvent): void => {\n event.preventDefault()\n this.dropzoneTarget.classList.remove('border-primary-500')\n this.dropzoneTarget.classList.add(\n 'border-gray-900/25',\n 'dark:border-neutral-600'\n )\n const files = event.dataTransfer?.files || []\n const file = files[0]\n if (!file) return\n\n const sizeInMB = file.size / 1024 / 1024\n if (sizeInMB > 5) return alert('File is too big')\n\n this.previewFile(file)\n this.uploadFile(file)\n }\n\n private previewFile(file: File): void {\n const fileReader = new FileReader()\n // @ts-ignore\n fileReader.onloadend = () => {\n const result = fileReader.result\n if (!result) return\n\n // @ts-ignore\n this.coverImagePreviewTarget.src = fileReader.result\n }\n\n fileReader.readAsDataURL(file)\n }\n\n private uploadFile = (file: File): void => {\n const url = this.coverImageInputTarget.dataset.directUploadUrl\n if (!url) return\n\n // @ts-ignore\n const upload = new DirectUpload(file, url, this)\n\n upload.create((error, blob) => {\n if (error) {\n // TODO: display the error message to the user\n console.log(error)\n } else {\n const hiddenField = document.createElement('input')\n hiddenField.setAttribute('type', 'hidden')\n hiddenField.setAttribute('value', blob.signed_id)\n hiddenField.name = this.coverImageInputTarget.name\n this.element.appendChild(hiddenField)\n }\n })\n }\n\n /**\n * Used as a delegate method for DirectUploadDelegate.\n * @param request {XMLHttpRequest} XHR request object\n */\n private directUploadWillStoreFileWithXHR = (request: XMLHttpRequest) => {\n request.upload.addEventListener('load', this.disableSaveButton)\n request.upload.addEventListener('error', this.enableSaveButton)\n request.upload.addEventListener('abort', this.enableSaveButton)\n request.upload.addEventListener('loadend', this.enableSaveButton)\n }\n\n private enableSaveButton = (_event: Event) => {\n this.saveButtonTarget.disabled = false\n }\n\n private disableSaveButton = (_event: Event) => {\n this.saveButtonTarget.disabled = true\n }\n}\n", "export var ZERO_WIDTH_CHAR = '\\u200B';\nexport var ZERO_WIDTH_UNICODE_CHAR = `​`", "import {ZERO_WIDTH_CHAR} from './constants'\n\nexport const logger = {\n isEnabled() { return window.TAGIFY_DEBUG ?? true},\n log(...args){ this.isEnabled() && console.log('[Tagify]:', ...args) },\n warn(...args) { this.isEnabled() && console.warn('[Tagify]:', ...args) }\n}\n\n// console.json = console.json || function(argument){\n// for(var arg=0; arg < arguments.length; ++arg)\n// console.log( JSON.stringify(arguments[arg], null, 4) )\n// }\n\n// const isEdge = /Edge/.test(navigator.userAgent)\nexport const sameStr = (s1, s2, caseSensitive, trim) => {\n // cast to String\n s1 = \"\"+s1;\n s2 = \"\"+s2;\n\n if( trim ){\n s1 = s1.trim()\n s2 = s2.trim()\n }\n\n return caseSensitive\n ? s1 == s2\n : s1.toLowerCase() == s2.toLowerCase()\n}\n\n\n// const getUID = () => (new Date().getTime() + Math.floor((Math.random()*10000)+1)).toString(16)\nexport const removeCollectionProp = (collection, unwantedProps) => collection && Array.isArray(collection) && collection.map(v => omit(v, unwantedProps))\n\nexport function omit(obj, props){\n var newObj = {}, p;\n for( p in obj )\n if( props.indexOf(p) < 0 )\n newObj[p] = obj[p]\n return newObj\n}\n\nexport function decode( s ) {\n var el = document.createElement('div');\n return s.replace(/\\&#?[0-9a-z]+;/gi, function(enc){\n el.innerHTML = enc;\n return el.innerText\n })\n}\n\n/**\n * utility method\n * https://stackoverflow.com/a/35385518/104380\n * @param {String} s [HTML string]\n * @return {Object} [DOM node]\n */\nexport function parseHTML( s ){\n var parser = new DOMParser(),\n node = parser.parseFromString(s.trim(), \"text/html\");\n\n return node.body.firstElementChild;\n}\n\n/**\n * Removed new lines and irrelevant spaces which might affect layout, and are better gone\n * @param {string} s [HTML string]\n */\nexport function minify( s ){\n return s ? s\n .replace(/\\>[\\r\\n ]+\\</g, \"><\")\n .split(/>\\s+</).join('><').trim()\n : \"\"\n}\n\nexport function removeTextChildNodes( elm ){\n var iter = document.createNodeIterator(elm, NodeFilter.SHOW_TEXT, null, false),\n textnode;\n\n // print all text nodes\n while (textnode = iter.nextNode()){\n if( !textnode.textContent.trim() )\n textnode.parentNode.removeChild(textnode)\n }\n}\n\nexport function getfirstTextNode( elm, action ){\n action = action || 'previous';\n while ( elm = elm[action + 'Sibling'] )\n if( elm.nodeType == 3 )\n return elm\n}\n\n/**\n * utility method\n * https://stackoverflow.com/a/6234804/104380\n */\nexport function escapeHTML( s ){\n return typeof s == 'string' ? s\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/`|'/g, \"'\")\n : s;\n}\n\n/**\n * Checks if an argument is a javascript Object\n */\nexport function isObject(obj) {\n var type = Object.prototype.toString.call(obj).split(' ')[1].slice(0, -1);\n return obj === Object(obj) && type != 'Array' && type != 'Function' && type != 'RegExp' && type != 'HTMLUnknownElement';\n}\n\n/**\n * merge objects into a single new one\n * TEST: extend({}, {a:{foo:1}, b:[]}, {a:{bar:2}, b:[1], c:()=>{}})\n */\nexport function extend( o, o1, o2) {\n if( !(o instanceof Object) ) o = {};\n\n copy(o, o1);\n if( o2 )\n copy(o, o2)\n\n function copy(a,b){\n // copy o2 to o\n for( var key in b )\n if( b.hasOwnProperty(key) ){\n if( isObject(b[key]) ){\n if( !isObject(a[key]) )\n a[key] = Object.assign({}, b[key])\n else\n copy(a[key], b[key])\n\n continue;\n }\n\n if( Array.isArray(b[key]) ){\n a[key] = Object.assign([], b[key])\n continue\n }\n\n a[key] = b[key]\n }\n }\n\n return o\n}\n\n/**\n * concatenates N arrays without dups.\n * If an array's item is an Object, compare by `value`\n */\nexport function concatWithoutDups(){\n const newArr = [],\n existingObj = {};\n\n for( let arr of arguments ) {\n for( let item of arr ) {\n // if current item is an object which has yet to be added to the new array\n if( isObject(item) ){\n if( !existingObj[item.value] ){\n newArr.push(item)\n existingObj[item.value] = 1\n }\n }\n\n // if current item is not an object and is not in the new array\n else if( !newArr.includes(item) )\n newArr.push(item)\n }\n }\n\n return newArr\n}\n\n/**\n * Extracted from: https://stackoverflow.com/a/37511463/104380\n * @param {String} s\n */\nexport function unaccent( s ){\n // if not supported, do not continue.\n // developers should use a polyfill:\n // https://github.com/walling/unorm\n if( !String.prototype.normalize )\n return s\n\n if (typeof(s) === 'string')\n return s.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\")\n}\n\n/**\n * Meassures an element's height, which might yet have been added DOM\n * https://stackoverflow.com/q/5944038/104380\n * @param {DOM} node\n */\nexport function getNodeHeight( node ){\n var height, clone = node.cloneNode(true)\n clone.style.cssText = \"position:fixed; top:-9999px; opacity:0\"\n document.body.appendChild(clone)\n height = clone.clientHeight\n clone.parentNode.removeChild(clone)\n return height\n}\n\nexport var isChromeAndroidBrowser = () => /(?=.*chrome)(?=.*android)/i.test(navigator.userAgent)\n\nexport function getUID() {\n return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>\n (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n )\n}\n\nexport function isNodeTag(node){\n return isNodeBelongsToThisTagifyInstance.call(this, node) && node?.classList?.contains(this.settings.classNames.tag)\n}\n\nexport function isWithinNodeTag(node){\n return isNodeBelongsToThisTagifyInstance.call(this, node) && node?.closest(this.settings.classNames.tagSelector)\n}\n\nfunction isNodeBelongsToThisTagifyInstance(node) {\n let closestTagifyNode = node?.closest?.(this.settings.classNames.namespaceSelector)\n return closestTagifyNode === this.DOM.scope\n}\n\n/**\n* Get the caret position relative to the viewport\n* https://stackoverflow.com/q/58985076/104380\n*\n* @returns {object} left, top distance in pixels\n*/\nexport function getCaretGlobalPosition(){\n const sel = document.getSelection()\n\n if( sel.rangeCount ){\n const r = sel.getRangeAt(0)\n const node = r.startContainer\n const offset = r.startOffset\n let rect, r2;\n\n if (offset > 0) {\n r2 = document.createRange()\n r2.setStart(node, offset - 1)\n r2.setEnd(node, offset)\n rect = r2.getBoundingClientRect()\n return {left:rect.right, top:rect.top, bottom:rect.bottom}\n }\n\n if( node.getBoundingClientRect )\n return node.getBoundingClientRect()\n }\n\n return {left:-9999, top:-9999}\n}\n\n/**\n * Injects content (either string or node) at the current the current (or specificed) caret position\n * @param {content} string/node\n * @param {range} Object (optional, a range other than the current window selection)\n */\nexport function injectAtCaret(content, range){\n var selection = window.getSelection();\n range = range || selection.getRangeAt(0)\n\n if( typeof content == 'string' )\n content = document.createTextNode(content)\n\n if( range ) {\n range.deleteContents()\n range.insertNode(content)\n }\n\n return content\n}\n\n/** Setter/Getter\n * Each tag DOM node contains a custom property called \"__tagifyTagData\" which hosts its data\n * @param {Node} tagElm\n * @param {Object} data\n */\nexport function getSetTagData(tagElm, data, override){\n if( !tagElm ){\n logger.warn(\"tag element doesn't exist\",{tagElm, data})\n return data\n }\n\n if( data )\n tagElm.__tagifyTagData = override\n ? data\n : extend({}, tagElm.__tagifyTagData || {}, data)\n\n return tagElm.__tagifyTagData\n}\n\nexport function placeCaretAfterNode( node ){\n if( !node || !node.parentNode ) return\n\n var nextSibling = node,\n sel = window.getSelection(),\n range = sel.getRangeAt(0);\n\n if (sel.rangeCount) {\n range.setStartAfter(nextSibling);\n range.collapse(true)\n // range.setEndBefore(nextSibling || node);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n}\n\n/**\n * iterate all tags, checking if multiple ones are close-siblings and if so, add a zero-space width character between them,\n * which forces the caret to be rendered when the selection is between tags.\n * Also do that if the tag is the first node.\n * @param {Array} tags\n */\nexport function fixCaretBetweenTags(tags, TagifyHasFocuse) {\n tags.forEach(tag => {\n if( getSetTagData(tag.previousSibling) || !tag.previousSibling ) {\n var textNode = document.createTextNode(ZERO_WIDTH_CHAR)\n tag.before(textNode)\n TagifyHasFocuse && placeCaretAfterNode(textNode)\n }\n })\n}\n\n", "export default {\r\n delimiters : \",\", // [RegEx] split tags by any of these delimiters (\"null\" to cancel) Example: \",| |.\"\r\n pattern : null, // RegEx pattern to validate input by. Ex: /[1-9]/\r\n tagTextProp : 'value', // tag data Object property which will be displayed as the tag's text\r\n maxTags : Infinity, // Maximum number of tags\r\n callbacks : {}, // Exposed callbacks object to be triggered on certain events\r\n addTagOnBlur : true, // automatically adds the text which was inputed as a tag when blur event happens\r\n addTagOn : ['blur', 'tab', 'enter'], // if the tagify field (in a normal mode) has any non-tag input in it, convert it to a tag on any of these events: blur away from the field, click \"tab\"/\"enter\" key\r\n onChangeAfterBlur : true, // By default, the native way of inputs' onChange events is kept, and it only fires when the field is blured.\r\n duplicates : false, // \"true\" - allow duplicate tags\r\n whitelist : [], // Array of tags to suggest as the user types (can be used along with \"enforceWhitelist\" setting)\r\n blacklist : [], // A list of non-allowed tags\r\n enforceWhitelist : false, // Only allow tags from the whitelist\r\n userInput : true, // disable manually typing/pasting/editing tags (tags may only be added from the whitelist)\r\n focusable : true, // Allow the component as a whole to recieve focus. There are implementations of Tagify without external border and so 'focusability' causes unwanted behaviour\r\n keepInvalidTags : false, // if true, do not remove tags which did not pass validation\r\n createInvalidTags : true, // if false, do not create invalid tags from invalid user input\r\n mixTagsAllowedAfter : /,|\\.|\\:|\\s/, // RegEx - Define conditions in which mix-tags content allows a tag to be added after\r\n mixTagsInterpolator : ['[[', ']]'], // Interpolation for mix mode. Everything between these will become a tag, if is a valid Object\r\n backspace : true, // false / true / \"edit\"\r\n skipInvalid : false, // If `true`, do not add invalid, temporary, tags before automatically removing them\r\n pasteAsTags : true, // automatically converts pasted text into tags. if \"false\", allows for further text editing\r\n\r\n editTags : {\r\n clicks : 2, // clicks to enter \"edit-mode\": 1 for single click. any other value is considered as double-click\r\n keepInvalid : true // keeps invalid edits as-is until `esc` is pressed while in focus\r\n }, // 1 or 2 clicks to edit a tag. false/null for not allowing editing\r\n transformTag : ()=>{}, // Takes a tag input string as argument and returns a transformed value\r\n trim : true, // whether or not the value provided should be trimmed, before being added as a tag\r\n a11y: {\r\n focusableTags: false\r\n },\r\n\r\n mixMode: {\r\n insertAfterTag : '\\u00A0', // String/Node to inject after a tag has been added (see #588)\r\n },\r\n\r\n autoComplete: {\r\n enabled: true, // Tries to suggest the input's value while typing (match from whitelist) by adding the rest of term as grayed-out text\r\n rightKey: false, // If `true`, when Right key is pressed, use the suggested value to create a tag, else just auto-completes the input. in mixed-mode this is set to \"true\"\r\n tabKey: false, // If 'true`, pressing `tab` key would only auto-complete but not also convert to a tag (like `rightKey` does).\r\n },\r\n\r\n classNames: {\r\n namespace : 'tagify',\r\n mixMode : 'tagify--mix',\r\n selectMode : 'tagify--select',\r\n input : 'tagify__input',\r\n focus : 'tagify--focus',\r\n tagNoAnimation : 'tagify--noAnim',\r\n tagInvalid : 'tagify--invalid',\r\n tagNotAllowed : 'tagify--notAllowed',\r\n scopeLoading : 'tagify--loading',\r\n hasMaxTags : 'tagify--hasMaxTags',\r\n hasNoTags : 'tagify--noTags',\r\n empty : 'tagify--empty',\r\n inputInvalid : 'tagify__input--invalid',\r\n dropdown : 'tagify__dropdown',\r\n dropdownWrapper : 'tagify__dropdown__wrapper',\r\n dropdownHeader : 'tagify__dropdown__header',\r\n dropdownFooter : 'tagify__dropdown__footer',\r\n dropdownItem : 'tagify__dropdown__item',\r\n dropdownItemActive : 'tagify__dropdown__item--active',\r\n dropdownItemHidden : 'tagify__dropdown__item--hidden',\r\n dropdownItemSelected : 'tagify__dropdown__item--selected',\r\n dropdownInital : 'tagify__dropdown--initial',\r\n tag : 'tagify__tag',\r\n tagText : 'tagify__tag-text',\r\n tagX : 'tagify__tag__removeBtn',\r\n tagLoading : 'tagify__tag--loading',\r\n tagEditing : 'tagify__tag--editable',\r\n tagFlash : 'tagify__tag--flash',\r\n tagHide : 'tagify__tag--hide',\r\n\r\n },\r\n\r\n dropdown: {\r\n classname : '',\r\n enabled : 2, // minimum input characters to be typed for the suggestions dropdown to show\r\n maxItems : 10,\r\n searchKeys : [\"value\", \"searchBy\"],\r\n fuzzySearch : true,\r\n caseSensitive : false,\r\n accentedSearch : true,\r\n includeSelectedTags: false, // Should the suggestions list Include already-selected tags (after filtering)\r\n escapeHTML : true, // escapes HTML entities in the suggestions' rendered text\r\n highlightFirst : true, // highlights first-matched item in the list\r\n closeOnSelect : true, // closes the dropdown after selecting an item, if `enabled:0` (which means always show dropdown)\r\n clearOnSelect : true, // after selecting a suggetion, should the typed text input remain or be cleared\r\n position : 'all', // 'manual' / 'text' / 'all'\r\n appendTarget : null // defaults to document.body once DOM has been loaded\r\n },\r\n\r\n hooks: {\r\n beforeRemoveTag: () => Promise.resolve(),\r\n beforePaste: () => Promise.resolve(),\r\n suggestionClick: () => Promise.resolve(),\r\n beforeKeyDown: () => Promise.resolve(),\r\n }\r\n}", "import { sameStr, isObject, minify, getNodeHeight, getCaretGlobalPosition } from './helpers'\nimport suggestionsMethods from './suggestions'\n\nexport function initDropdown(){\n this.dropdown = {}\n\n // auto-bind \"this\" to all the dropdown methods\n for( let p in this._dropdown )\n this.dropdown[p] = typeof this._dropdown[p] === 'function'\n ? this._dropdown[p].bind(this)\n : this._dropdown[p]\n\n this.dropdown.refs()\n this.DOM.dropdown.__tagify = this\n}\n\nexport default {\n ...suggestionsMethods,\n\n refs(){\n this.DOM.dropdown = this.parseTemplate('dropdown', [this.settings])\n this.DOM.dropdown.content = this.DOM.dropdown.querySelector(\"[data-selector='tagify-suggestions-wrapper']\")\n },\n\n getHeaderRef(){\n return this.DOM.dropdown.querySelector(\"[data-selector='tagify-suggestions-header']\")\n },\n\n getFooterRef(){\n return this.DOM.dropdown.querySelector(\"[data-selector='tagify-suggestions-footer']\")\n },\n\n getAllSuggestionsRefs(){\n return [...this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector)]\n },\n\n /**\n * shows the suggestions select box\n * @param {String} value [optional, filter the whitelist by this value]\n */\n show( value ){\n var _s = this.settings,\n firstListItem,\n firstListItemValue,\n allowNewTags = _s.mode == 'mix' && !_s.enforceWhitelist,\n noWhitelist = !_s.whitelist || !_s.whitelist.length,\n noMatchListItem,\n isManual = _s.dropdown.position == 'manual';\n\n // if text still exists in the input, and `show` method has no argument, then the input's text should be used\n value = value === undefined ? this.state.inputText : value\n\n // ⚠️ Do not render suggestions list if:\n // 1. there's no whitelist (can happen while async loading) AND new tags arn't allowed\n // 2. dropdown is disabled\n // 3. loader is showing (controlled outside of this code)\n if( (noWhitelist && !allowNewTags && !_s.templates.dropdownItemNoMatch)\n || _s.dropdown.enabled === false\n || this.state.isLoading\n || this.settings.readonly )\n return;\n\n clearTimeout(this.dropdownHide__bindEventsTimeout)\n\n // if no value was supplied, show all the \"whitelist\" items in the dropdown\n // @type [Array] listItems\n this.suggestedListItems = this.dropdown.filterListItems(value)\n\n // trigger at this exact point to let the developer the chance to manually set \"this.suggestedListItems\"\n if( value && !this.suggestedListItems.length ){\n this.trigger('dropdown:noMatch', value)\n\n if( _s.templates.dropdownItemNoMatch )\n noMatchListItem = _s.templates.dropdownItemNoMatch.call(this, {value})\n }\n\n // if \"dropdownItemNoMatch\" was not defined, procceed regular flow.\n //\n if( !noMatchListItem ){\n // in mix-mode, if the value isn't included in the whilelist & \"enforceWhitelist\" setting is \"false\",\n // then add a custom suggestion item to the dropdown\n if( this.suggestedListItems.length ){\n if( value && allowNewTags && !this.state.editing.scope && !sameStr(this.suggestedListItems[0].value, value) )\n this.suggestedListItems.unshift({value})\n }\n else{\n if( value && allowNewTags && !this.state.editing.scope ){\n this.suggestedListItems = [{value}]\n }\n // hide suggestions list if no suggestion matched\n else{\n this.input.autocomplete.suggest.call(this);\n this.dropdown.hide()\n return;\n }\n }\n\n firstListItem = this.suggestedListItems[0]\n firstListItemValue = \"\"+(isObject(firstListItem) ? firstListItem.value : firstListItem)\n\n if( _s.autoComplete && firstListItemValue ){\n // only fill the sugegstion if the value of the first list item STARTS with the input value (regardless of \"fuzzysearch\" setting)\n if( firstListItemValue.indexOf(value) == 0 )\n this.input.autocomplete.suggest.call(this, firstListItem)\n }\n }\n\n this.dropdown.fill(noMatchListItem)\n\n if( _s.dropdown.highlightFirst ) {\n this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(_s.classNames.dropdownItemSelector))\n }\n\n // bind events, exactly at this stage of the code. \"dropdown.show\" method is allowed to be\n // called multiple times, regardless if the dropdown is currently visible, but the events-binding\n // should only be called if the dropdown wasn't previously visible.\n if( !this.state.dropdown.visible )\n // timeout is needed for when pressing arrow down to show the dropdown,\n // so the key event won't get registered in the dropdown events listeners\n setTimeout(this.dropdown.events.binding.bind(this))\n\n // set the dropdown visible state to be the same as the searched value.\n // MUST be set *before* position() is called\n this.state.dropdown.visible = value || true\n this.state.dropdown.query = value\n\n this.setStateSelection()\n\n // try to positioning the dropdown (it might not yet be on the page, doesn't matter, next code handles this)\n if( !isManual ){\n // a slight delay is needed if the dropdown \"position\" setting is \"text\", and nothing was typed in the input,\n // so sadly the \"getCaretGlobalPosition\" method doesn't recognize the caret position without this delay\n setTimeout(() => {\n this.dropdown.position()\n this.dropdown.render()\n })\n }\n\n // a delay is needed because of the previous delay reason.\n // this event must be fired after the dropdown was rendered & positioned\n setTimeout(() => {\n this.trigger(\"dropdown:show\", this.DOM.dropdown)\n })\n },\n\n /**\n * Hides the dropdown (if it's not managed manually by the developer)\n * @param {Boolean} overrideManual\n */\n hide( overrideManual ){\n var {scope, dropdown} = this.DOM,\n isManual = this.settings.dropdown.position == 'manual' && !overrideManual;\n\n // if there's no dropdown, this means the dropdown events aren't binded\n if( !dropdown || !document.body.contains(dropdown) || isManual ) return;\n\n window.removeEventListener('resize', this.dropdown.position)\n this.dropdown.events.binding.call(this, false) // unbind all events\n\n // if the dropdown is open, and the input (scope) is clicked,\n // the dropdown should be now \"close\", and the next click (on the scope)\n // should re-open it, and without a timeout, clicking to close will re-open immediately\n // clearTimeout(this.dropdownHide__bindEventsTimeout)\n // this.dropdownHide__bindEventsTimeout = setTimeout(this.events.binding.bind(this), 250) // re-bind main events\n\n\n scope.setAttribute(\"aria-expanded\", false)\n dropdown.parentNode.removeChild(dropdown)\n\n // scenario: clicking the scope to show the dropdown, clicking again to hide -> calls dropdown.hide() and then re-focuses the input\n // which casues another onFocus event, which checked \"this.state.dropdown.visible\" and see it as \"false\" and re-open the dropdown\n setTimeout(() => {\n this.state.dropdown.visible = false\n }, 100)\n\n this.state.dropdown.query =\n this.state.ddItemData =\n this.state.ddItemElm =\n this.state.selection = null\n\n // if the user closed the dropdown (in mix-mode) while a potential tag was detected, flag the current tag\n // so the dropdown won't be shown on following user input for that \"tag\"\n if( this.state.tag && this.state.tag.value.length ){\n this.state.flaggedTags[this.state.tag.baseOffset] = this.state.tag\n }\n\n this.trigger(\"dropdown:hide\", dropdown)\n\n return this\n },\n\n /**\n * Toggles dropdown show/hide\n * @param {Boolean} show forces the dropdown to show\n */\n toggle(show){\n this.dropdown[this.state.dropdown.visible && !show ? 'hide' : 'show']()\n },\n\n getAppendTarget() {\n var _sd = this.settings.dropdown;\n return typeof _sd.appendTarget === 'function' ? _sd.appendTarget() : _sd.appendTarget;\n },\n\n render(){\n // let the element render in the DOM first, to accurately measure it.\n // this.DOM.dropdown.style.cssText = \"left:-9999px; top:-9999px;\";\n var ddHeight = getNodeHeight(this.DOM.dropdown),\n _s = this.settings,\n appendTarget = this.dropdown.getAppendTarget();\n\n if( _s.dropdown.enabled === false ) return this;\n\n this.DOM.scope.setAttribute(\"aria-expanded\", true)\n\n // if the dropdown has yet to be appended to the DOM,\n // append the dropdown to the body element & handle events\n if( !document.body.contains(this.DOM.dropdown) ){\n this.DOM.dropdown.classList.add( _s.classNames.dropdownInital )\n this.dropdown.position(ddHeight)\n appendTarget.appendChild(this.DOM.dropdown)\n\n setTimeout(() =>\n this.DOM.dropdown.classList.remove( _s.classNames.dropdownInital )\n )\n }\n\n return this\n },\n\n /**\n * re-renders the dropdown content element (see \"dropdownContent\" in templates file)\n * @param {String/Array} HTMLContent - optional\n */\n fill( HTMLContent ){\n HTMLContent = typeof HTMLContent == 'string'\n ? HTMLContent\n : this.dropdown.createListHTML(HTMLContent || this.suggestedListItems)\n\n var dropdownContent = this.settings.templates.dropdownContent.call(this, HTMLContent)\n\n this.DOM.dropdown.content.innerHTML = minify(dropdownContent)\n },\n\n /**\n * Re-renders only the header & footer.\n * Used when selecting a suggestion and it is wanted that the suggestions dropdown stays open.\n * Since the list of sugegstions is not being re-rendered completely every time a suggestion is selected (the item is transitioned-out)\n * then the header & footer should be kept in sync with the suggestions data change\n */\n fillHeaderFooter(){\n var suggestions = this.dropdown.filterListItems(this.state.dropdown.query),\n newHeaderElem = this.parseTemplate('dropdownHeader', [suggestions]),\n newFooterElem = this.parseTemplate('dropdownFooter', [suggestions]),\n headerRef = this.dropdown.getHeaderRef(),\n footerRef = this.dropdown.getFooterRef();\n\n newHeaderElem && headerRef?.parentNode.replaceChild(newHeaderElem, headerRef)\n newFooterElem && footerRef?.parentNode.replaceChild(newFooterElem, footerRef)\n },\n\n /**\n * dropdown positioning logic\n * (shown above/below or next to typed text for mix-mode)\n */\n position( ddHeight ){\n var _sd = this.settings.dropdown,\n appendTarget = this.dropdown.getAppendTarget();\n\n if( _sd.position == 'manual' || !appendTarget) return\n\n var rect, top, bottom, left, width, ancestorsOffsets,\n isPlacedAbove, hasSpaceOnRight,\n cssTop, cssLeft,\n ddElm = this.DOM.dropdown,\n isRTL = _sd.RTL,\n isDefaultAppendTarget = appendTarget === document.body,\n isSelfAppended = appendTarget === this.DOM.scope,\n appendTargetScrollTop = isDefaultAppendTarget ? window.pageYOffset : appendTarget.scrollTop,\n root = document.fullscreenElement || document.webkitFullscreenElement || document.documentElement,\n viewportHeight = root.clientHeight,\n viewportWidth = Math.max(root.clientWidth || 0, window.innerWidth || 0),\n positionTo = viewportWidth > 480 ? _sd.position : 'all',\n ddTarget = this.DOM[positionTo == 'input' ? 'input' : 'scope'],\n MIN_DISTANCE_FROM_VIEWPORT_H_EDGE = 120;\n\n ddHeight = ddHeight || ddElm.clientHeight\n\n function getAncestorsOffsets(p){\n var top = 0, left = 0;\n\n p = p.parentNode;\n\n // when in element-fullscreen mode, do not go above the fullscreened-element\n while(p && p != root){\n top += p.offsetTop || 0\n left += p.offsetLeft || 0\n p = p.parentNode\n }\n\n return {top, left};\n }\n\n function getAccumulatedAncestorsScrollTop() {\n var scrollTop = 0,\n p = _sd.appendTarget.parentNode;\n\n while(p){\n scrollTop += p.scrollTop || 0;\n p = p.parentNode\n }\n\n return scrollTop;\n }\n\n if( !this.state.dropdown.visible ) return\n\n if( positionTo == 'text' ){\n rect = getCaretGlobalPosition()\n bottom = rect.bottom\n top = rect.top\n left = rect.left\n width = 'auto'\n }\n\n else{\n ancestorsOffsets = getAncestorsOffsets(appendTarget)\n rect = ddTarget.getBoundingClientRect()\n top = isSelfAppended ? -1 : rect.top - ancestorsOffsets.top\n bottom = (isSelfAppended ? rect.height : rect.bottom - ancestorsOffsets.top) - 1\n left = isSelfAppended ? -1 : rect.left - ancestorsOffsets.left\n width = rect.width + 'px'\n }\n\n // if the \"append target\" isn't the default, correct the `top` variable by ignoring any scrollTop of the target's Ancestors\n if( !isDefaultAppendTarget ) {\n let accumulatedAncestorsScrollTop = getAccumulatedAncestorsScrollTop()\n top += accumulatedAncestorsScrollTop\n bottom += accumulatedAncestorsScrollTop\n }\n\n top = Math.floor(top)\n bottom = Math.ceil(bottom)\n\n isPlacedAbove = _sd.placeAbove ?? viewportHeight - rect.bottom < ddHeight\n hasSpaceOnRight = viewportWidth - left < MIN_DISTANCE_FROM_VIEWPORT_H_EDGE;\n\n // flip vertically if there is no space for the dropdown below the input\n cssTop = (isPlacedAbove ? top : bottom) + appendTargetScrollTop;\n\n // \"pageXOffset\" property is an alias for \"scrollX\"\n cssLeft = (left + (isRTL ? (rect.width || 0) : 0) + window.pageXOffset);\n\n // check if there's enough space on the right-side of the viewport,\n // because the element is positioned to the right of the caret, which might need to be changed.\n if( positionTo == 'text' && hasSpaceOnRight ) {\n cssLeft = `right: 0;`;\n }\n else {\n cssLeft = `left: ${cssLeft}px;`;\n }\n\n // rtl = rtl ?? viewportWidth -\n ddElm.style.cssText = `${cssLeft} top: ${cssTop}px; min-width: ${width}; max-width: ${width}`;\n\n ddElm.setAttribute('placement', isPlacedAbove ? 'top' : 'bottom')\n ddElm.setAttribute('position', positionTo)\n },\n}\n", "import { isObject, escapeHTML, extend, unaccent, logger } from './helpers'\n\n\n/**\n * Tagify's dropdown suggestions-related logic\n */\n\nexport default {\n events : {\n /**\n * Events should only be binded when the dropdown is rendered and removed when isn't\n * because there might be multiple Tagify instances on a certain page\n * @param {Boolean} bindUnbind [optional. true when wanting to unbind all the events]\n */\n binding( bindUnbind = true ){\n // references to the \".bind()\" methods must be saved so they could be unbinded later\n var _CB = this.dropdown.events.callbacks,\n // callback-refs\n _CBR = (this.listeners.dropdown = this.listeners.dropdown || {\n position : this.dropdown.position.bind(this, null),\n onKeyDown : _CB.onKeyDown.bind(this),\n onMouseOver : _CB.onMouseOver.bind(this),\n onMouseLeave : _CB.onMouseLeave.bind(this),\n onClick : _CB.onClick.bind(this),\n onScroll : _CB.onScroll.bind(this),\n }),\n action = bindUnbind ? 'addEventListener' : 'removeEventListener';\n\n if( this.settings.dropdown.position != 'manual' ){\n document[action]('scroll', _CBR.position, true)\n window[action]('resize', _CBR.position)\n window[action]('keydown', _CBR.onKeyDown)\n }\n\n this.DOM.dropdown[action]('mouseover', _CBR.onMouseOver)\n this.DOM.dropdown[action]('mouseleave', _CBR.onMouseLeave)\n this.DOM.dropdown[action]('mousedown', _CBR.onClick)\n this.DOM.dropdown.content[action]('scroll', _CBR.onScroll)\n },\n\n callbacks : {\n onKeyDown(e){\n // ignore keys during IME composition\n if( !this.state.hasFocus || this.state.composing )\n return\n\n // get the \"active\" element, and if there was none (yet) active, use first child\n var _s = this.settings,\n includeSelectedTags = _s.dropdown.includeSelectedTags,\n selectedElm = this.DOM.dropdown.querySelector(_s.classNames.dropdownItemActiveSelector),\n selectedElmData = this.dropdown.getSuggestionDataByNode(selectedElm),\n isMixMode = _s.mode == 'mix',\n isSelectMode = _s.mode == 'select';\n\n _s.hooks.beforeKeyDown(e, {tagify:this})\n .then(result => {\n switch( e.key ){\n case 'ArrowDown' :\n case 'ArrowUp' :\n case 'Down' : // >IE11\n case 'Up' : { // >IE11\n e.preventDefault()\n var dropdownItems = this.dropdown.getAllSuggestionsRefs(),\n actionUp = e.key == 'ArrowUp' || e.key == 'Up';\n\n if( selectedElm ) {\n selectedElm = this.dropdown.getNextOrPrevOption(selectedElm, !actionUp)\n }\n\n // if no element was found OR current item is not a \"real\" item, loop\n if( !selectedElm || !selectedElm.matches(_s.classNames.dropdownItemSelector) ){\n selectedElm = dropdownItems[actionUp ? dropdownItems.length - 1 : 0];\n }\n\n this.dropdown.highlightOption(selectedElm, true)\n // selectedElm.scrollIntoView({inline: 'nearest', behavior: 'smooth'})\n break;\n }\n case 'PageUp':\n case 'PageDown': {\n e.preventDefault()\n const dropdownItems = this.dropdown.getAllSuggestionsRefs()\n const itemsPerPage = Math.floor(this.DOM.dropdown.content.clientHeight / dropdownItems[0]?.offsetHeight) || 1\n const isPageUp = e.key === 'PageUp'\n\n if (selectedElm) {\n const currentIndex = dropdownItems.indexOf(selectedElm)\n const targetIndex = isPageUp\n ? Math.max(0, currentIndex - itemsPerPage)\n : Math.min(dropdownItems.length - 1, currentIndex + itemsPerPage)\n selectedElm = dropdownItems[targetIndex]\n } else {\n selectedElm = dropdownItems[0]\n }\n\n this.dropdown.highlightOption(selectedElm, true)\n break;\n }\n case 'Home':\n case 'End': {\n e.preventDefault()\n const dropdownItems = this.dropdown.getAllSuggestionsRefs()\n selectedElm = dropdownItems[e.key === 'Home' ? 0 : dropdownItems.length - 1]\n this.dropdown.highlightOption(selectedElm, true)\n break;\n }\n case 'Escape' :\n case 'Esc': // IE11\n this.dropdown.hide();\n break;\n\n case 'ArrowRight' :\n // do not continue if the left arrow key was pressed while typing, because assuming the user wants to bypass any of the below logic and edit the content without intervention.\n // also do not procceed if a tag should be created when the setting `autoComplete.rightKey` is set to `true`\n if( this.state.actions.ArrowLeft || _s.autoComplete.rightKey )\n return\n case 'Tab' : {\n let shouldAutocompleteOnKey = !_s.autoComplete.rightKey || !_s.autoComplete.tabKey\n\n // in mix-mode, treat arrowRight like Enter key, so a tag will be created\n if( !isMixMode && !isSelectMode && selectedElm && shouldAutocompleteOnKey && !this.state.editing && selectedElmData ){\n e.preventDefault() // prevents blur so the autocomplete suggestion will not become a tag\n var value = this.dropdown.getMappedValue(selectedElmData)\n\n this.state.autoCompleteData = selectedElmData;\n this.input.autocomplete.set.call(this, value)\n return false\n }\n return true\n }\n case 'Enter' : {\n e.preventDefault()\n\n // temporary set the \"actions\" state to indicate to the main \"blur\" event it shouldn't execute any if its logic.\n // a `100ms` is a good-enough timeout after some testing\n this.state.actions.selectOption = true;\n setTimeout(()=> this.state.actions.selectOption = false, 100)\n\n _s.hooks.suggestionClick(e, {tagify:this, tagData:selectedElmData, suggestionElm:selectedElm})\n .then(() => {\n if( selectedElm ){\n var nextOrPrevOption = includeSelectedTags ? selectedElm : this.dropdown.getNextOrPrevOption(selectedElm, !actionUp);\n\n this.dropdown.selectOption(selectedElm, e, () => {\n // highlight next option\n if(nextOrPrevOption) {\n var nextOrPrevOptionValue = nextOrPrevOption.getAttribute('value')\n nextOrPrevOption = this.dropdown.getSuggestionNodeByValue(nextOrPrevOptionValue)\n this.dropdown.highlightOption(nextOrPrevOption)\n }\n })\n\n return\n }\n else\n this.dropdown.hide()\n\n if( !isMixMode )\n this.addTags(this.state.inputText.trim(), true)\n })\n .catch(err => logger.warn(err))\n\n break;\n }\n case 'Backspace' : {\n if( isMixMode || this.state.editing.scope ) return;\n\n const value = this.input.raw.call(this)\n\n if( value == \"\" || value.charCodeAt(0) == 8203 ){\n if( _s.backspace === true )\n this.removeTags()\n else if( _s.backspace == 'edit' )\n setTimeout(this.editTag.bind(this), 0)\n }\n }\n }\n })\n },\n\n onMouseOver(e){\n var ddItem = e.target.closest(this.settings.classNames.dropdownItemSelector)\n // event delegation check\n this.dropdown.highlightOption(ddItem)\n },\n\n onMouseLeave(e){\n // de-highlight any previously highlighted option\n this.dropdown.highlightOption()\n },\n\n onClick(e){\n if( e.button != 0 || e.target == this.DOM.dropdown || e.target == this.DOM.dropdown.content ) return; // allow only mouse left-clicks\n\n var selectedElm = e.target.closest(this.settings.classNames.dropdownItemSelector),\n selectedElmData = this.dropdown.getSuggestionDataByNode(selectedElm)\n\n // temporary set the \"actions\" state to indicate to the main \"blur\" event it shouldn't execute any if its logic.\n // a `100ms` is a good-enough timeout after some testing\n this.state.actions.selectOption = true;\n setTimeout(()=> this.state.actions.selectOption = false, 100)\n\n this.settings.hooks.suggestionClick(e, {tagify:this, tagData:selectedElmData, suggestionElm:selectedElm})\n .then(() => {\n if( selectedElm )\n this.dropdown.selectOption(selectedElm, e)\n else\n this.dropdown.hide()\n })\n .catch(err => logger.warn(err))\n },\n\n onScroll(e){\n var elm = e.target,\n pos = elm.scrollTop / (elm.scrollHeight - elm.parentNode.clientHeight) * 100;\n\n this.trigger(\"dropdown:scroll\", {percentage:Math.round(pos)})\n },\n }\n },\n\n /**\n * fill data into the suggestions list\n * (mainly used to update the list when removing tags while the suggestions dropdown is visible, so they will be re-added to the list. not efficient)\n */\n refilter( value ){\n value = value || this.state.dropdown.query || ''\n this.suggestedListItems = this.dropdown.filterListItems(value)\n\n this.dropdown.fill()\n\n if( !this.suggestedListItems.length )\n this.dropdown.hide()\n\n this.trigger(\"dropdown:updated\", this.DOM.dropdown)\n },\n\n /**\n * Given a suggestion-item, return the data associated with it\n * @param {HTMLElement} tagElm\n * @returns Object\n */\n getSuggestionDataByNode( tagElm ){\n var item, value = tagElm && tagElm.getAttribute('value')\n\n for(var i = this.suggestedListItems.length; i--; ) {\n item = this.suggestedListItems[i]\n if( isObject(item) && item.value == value ) return item\n // for primitive whitelist items:\n else if( item == value ) return {value: item}\n }\n },\n\n getSuggestionNodeByValue( value ){\n var dropdownItems = this.dropdown.getAllSuggestionsRefs()\n return dropdownItems.find(item => item.getAttribute('value') === value);\n },\n\n getNextOrPrevOption(selected, next = true) {\n var dropdownItems = this.dropdown.getAllSuggestionsRefs(),\n selectedIdx = dropdownItems.findIndex(item => item === selected);\n\n return next ? dropdownItems[selectedIdx + 1] : dropdownItems[selectedIdx - 1]\n },\n\n /**\n * mark the currently active suggestion option\n * @param {Object} elm option DOM node\n * @param {Boolean} adjustScroll when navigation with keyboard arrows (up/down), auto-scroll to always show the highlighted element\n */\n highlightOption( elm, adjustScroll ){\n var className = this.settings.classNames.dropdownItemActive,\n itemData;\n\n // focus casues a bug in Firefox with the placeholder been shown on the input element\n // if( this.settings.dropdown.position != 'manual' )\n // elm.focus();\n\n if( this.state.ddItemElm ){\n this.state.ddItemElm.classList.remove(className)\n this.state.ddItemElm.removeAttribute(\"aria-selected\")\n }\n\n if( !elm ){\n this.state.ddItemData = null\n this.state.ddItemElm = null\n this.input.autocomplete.suggest.call(this)\n return;\n }\n\n itemData = this.dropdown.getSuggestionDataByNode(elm)\n this.state.ddItemData = itemData\n this.state.ddItemElm = elm\n\n // this.DOM.dropdown.querySelectorAll(\".\" + this.settings.classNames.dropdownItemActive).forEach(activeElm => activeElm.classList.remove(className));\n elm.classList.add(className);\n elm.setAttribute(\"aria-selected\", true)\n\n if( adjustScroll )\n elm.parentNode.scrollTop = elm.clientHeight + elm.offsetTop - elm.parentNode.clientHeight\n\n // Try to autocomplete the typed value with the currently highlighted dropdown item\n if( this.settings.autoComplete ){\n this.input.autocomplete.suggest.call(this, itemData)\n this.dropdown.position() // suggestions might alter the height of the tagify wrapper because of unkown suggested term length that could drop to the next line\n }\n },\n\n /**\n * Create a tag from the currently active suggestion option\n * @param {Object} elm DOM node to select\n * @param {Object} event The original Click event, if available (since keyboard ENTER key also triggers this method)\n */\n selectOption( elm, event, onSelect ){\n var _s = this.settings,\n includeSelectedTags = _s.dropdown.includeSelectedTags,\n {clearOnSelect, closeOnSelect} = _s.dropdown;\n\n if( !elm ) {\n this.addTags(this.state.inputText, true)\n closeOnSelect && this.dropdown.hide()\n return;\n }\n\n event = event || {}\n\n // if in edit-mode, do not continue but instead replace the tag's text.\n // the scenario is that \"addTags\" was called from a dropdown suggested option selected while editing\n\n var value = elm.getAttribute('value'),\n isNoMatch = value == 'noMatch',\n isMixMode = _s.mode == 'mix',\n tagData = this.suggestedListItems.find(item => (item.value ?? item) == value)\n\n // The below event must be triggered, regardless of anything else which might go wrong\n this.trigger('dropdown:select', {data:tagData, elm, event})\n\n if( !tagData && !isNoMatch ){\n closeOnSelect && setTimeout(this.dropdown.hide.bind(this))\n return\n }\n\n if( this.state.editing ) {\n let normalizedTagData = this.normalizeTags([tagData])[0]\n tagData = _s.transformTag.call(this, normalizedTagData) || normalizedTagData\n\n // normalizing value, because \"tagData\" might be a string, and therefore will not be able to extend the object\n this.onEditTagDone(null, extend({__isValid: true}, tagData))\n }\n // Tagify instances should re-focus to the input element once an option was selected, to allow continuous typing\n else {\n this[isMixMode ? \"addMixTags\" : \"addTags\"]([tagData || this.input.raw.call(this)], clearOnSelect)\n }\n\n if( !isMixMode && !this.DOM.input.parentNode )\n return\n\n setTimeout(() => {\n this.DOM.input.focus()\n this.toggleFocusClass(true)\n })\n\n closeOnSelect && setTimeout(this.dropdown.hide.bind(this))\n\n // execute these tasks once a suggestion has been selected\n if(includeSelectedTags) {\n onSelect && onSelect()\n }\n\n // if the selected suggestion is removed after being selected, more things things needs to be done:\n else {\n elm.addEventListener('transitionend', () => {\n this.dropdown.fillHeaderFooter()\n\n setTimeout(() => {\n elm.remove()\n this.dropdown.refilter()\n onSelect && onSelect()\n }, 100)\n }, {once: true})\n\n // hide selected suggestion\n elm.classList.add(this.settings.classNames.dropdownItemHidden)\n }\n },\n\n // adds all the suggested items, including the ones which are not currently rendered,\n // unless specified otherwise (by the \"onlyRendered\" argument)\n selectAll( onlyRendered ){\n // having suggestedListItems with items messes with \"normalizeTags\" when wanting\n // to add all tags\n this.suggestedListItems.length = 0;\n this.dropdown.hide()\n\n this.dropdown.filterListItems('');\n\n var tagsToAdd = this.dropdown.filterListItems('');\n\n if( !onlyRendered )\n tagsToAdd = this.state.dropdown.suggestions\n\n // some whitelist items might have already been added as tags so when addings all of them,\n // skip adding already-added ones, so best to use \"filterListItems\" method over \"settings.whitelist\"\n this.addTags(tagsToAdd, true)\n return this\n },\n\n /**\n * returns an HTML string of the suggestions' list items\n * @param {String} value string t\n * o filter the whitelist by\n * @param {Object} options \"exact\" - for exact complete match\n * @return {Array} list of filtered whitelist items according to the settings provided and current value\n */\n filterListItems( value, options ){\n var _s = this.settings,\n _sd = _s.dropdown,\n options = options || {},\n list = [],\n exactMatchesList = [],\n whitelist = _s.whitelist,\n suggestionsCount = _sd.maxItems >= 0 ? _sd.maxItems : Infinity,\n includeSelectedTags = _sd.includeSelectedTags,\n hasCustomSort = typeof _sd.sortby == 'function',\n searchKeys = _sd.searchKeys,\n whitelistItem,\n valueIsInWhitelist,\n searchBy,\n isDuplicate,\n niddle,\n i = 0;\n\n value = (_s.mode == 'select' && this.value.length && this.value[0][_s.tagTextProp] == value\n ? '' // do not filter if the tag, which is already selecetd in \"select\" mode, is the same as the typed text\n : value);\n\n if( !value || !searchKeys.length ){\n list = includeSelectedTags\n ? whitelist\n : whitelist.filter(item => !this.isTagDuplicate( isObject(item) ? item.value : item )) // don't include tags which have already been added.\n\n var filteredList = hasCustomSort\n ? _sd.sortby(list, niddle)\n : list.slice(0, suggestionsCount); // respect \"maxItems\" dropdown setting\n\n this.state.dropdown.suggestions = filteredList;\n\n return filteredList;\n }\n\n niddle = _sd.caseSensitive\n ? \"\"+value\n : (\"\"+value).toLowerCase()\n\n // checks if ALL of the words in the search query exists in the current whitelist item, regardless of their order\n function stringHasAll(s, query){\n return query.toLowerCase().split(' ').every(q => s.includes(q.toLowerCase()))\n }\n\n for( ; i < whitelist.length; i++ ){\n let startsWithMatch, exactMatch;\n\n whitelistItem = whitelist[i] instanceof Object ? whitelist[i] : { value:whitelist[i] } //normalize value as an Object\n\n let itemWithoutSearchKeys = !Object.keys(whitelistItem).some(k => searchKeys.includes(k) ),\n _searchKeys = itemWithoutSearchKeys ? [\"value\"] : searchKeys\n\n if( _sd.fuzzySearch && !options.exact ){\n searchBy = _searchKeys.reduce((values, k) => values + \" \" + (whitelistItem[k]||\"\"), \"\").toLowerCase().trim()\n\n if( _sd.accentedSearch ){\n searchBy = unaccent(searchBy)\n niddle = unaccent(niddle)\n }\n\n startsWithMatch = searchBy.indexOf(niddle) == 0\n exactMatch = searchBy === niddle\n valueIsInWhitelist = stringHasAll(searchBy, niddle)\n }\n\n else {\n startsWithMatch = true;\n valueIsInWhitelist = _searchKeys.some(k => {\n var v = '' + (whitelistItem[k] || '') // if key exists, cast to type String\n\n if( _sd.accentedSearch ){\n v = unaccent(v)\n niddle = unaccent(niddle)\n }\n\n if( !_sd.caseSensitive )\n v = v.toLowerCase()\n\n exactMatch = v === niddle\n\n return options.exact\n ? v === niddle\n : v.indexOf(niddle) == 0\n })\n }\n\n isDuplicate = !_sd.includeSelectedTags && this.isTagDuplicate( isObject(whitelistItem) ? whitelistItem.value : whitelistItem )\n\n // match for the value within each \"whitelist\" item\n if( valueIsInWhitelist && !isDuplicate )\n if( exactMatch && startsWithMatch)\n exactMatchesList.push(whitelistItem)\n else if( _sd.sortby == 'startsWith' && startsWithMatch )\n list.unshift(whitelistItem)\n else\n list.push(whitelistItem)\n }\n\n this.state.dropdown.suggestions = exactMatchesList.concat(list);\n\n // custom sorting function\n var filteredList = hasCustomSort\n ? _sd.sortby(exactMatchesList.concat(list), niddle)\n : exactMatchesList.concat(list).slice(0, suggestionsCount)\n\n this.state.dropdown.suggestions = filteredList;\n return filteredList\n },\n\n /**\n * Returns the final value of a tag data (object) with regards to the \"mapValueTo\" dropdown setting\n * @param {Object} tagData\n * @returns\n */\n getMappedValue(tagData){\n var mapValueTo = this.settings.dropdown.mapValueTo,\n value = (mapValueTo\n ? typeof mapValueTo == 'function' ? mapValueTo(tagData) : (tagData[mapValueTo] || tagData.value)\n : tagData.value);\n\n return value\n },\n\n /**\n * Creates the dropdown items' HTML\n * @param {Array} sugegstionsList [Array of Objects]\n * @return {String}\n */\n createListHTML( sugegstionsList ){\n return extend([], sugegstionsList).map((suggestion, idx) => {\n if( typeof suggestion == 'string' || typeof suggestion == 'number' )\n suggestion = {value:suggestion}\n\n var mappedValue = this.dropdown.getMappedValue(suggestion);\n\n mappedValue = (typeof mappedValue == 'string' && this.settings.dropdown.escapeHTML)\n ? escapeHTML(mappedValue)\n : mappedValue;\n\n return this.settings.templates.dropdownItem.apply(this, [{...suggestion, mappedValue}, this])\n }).join(\"\")\n }\n}", "const VERSION = 1; // current version of persisted data. if code change breaks persisted data, verison number should be bumped.\nconst STORE_KEY = '@yaireo/tagify/'\n\nexport const getPersistedData = id => key => {\n if( !id ) return;\n\n // if \"persist\" is \"false\", do not save to localstorage\n let customKey = '/'+key,\n persistedData,\n currentStorageVersion = localStorage?.getItem(STORE_KEY + id + '/v')\n\n if( currentStorageVersion === VERSION){\n try{ persistedData = JSON.parse(localStorage[STORE_KEY + id + customKey]) }\n catch(err){}\n }\n\n return persistedData\n}\n\nexport const setPersistedData = id => {\n if( !id ) return () => {};\n\n // for storage invalidation\n localStorage?.setItem(STORE_KEY + id + '/v', VERSION)\n\n return (data, key) => {\n let customKey = '/'+key,\n persistedData = JSON.stringify(data)\n\n if( data && key ){\n localStorage?.setItem(STORE_KEY + id + customKey, persistedData)\n dispatchEvent( new Event('storage') )\n }\n }\n}\n\nexport const clearPersistedData = id => key => {\n const base = STORE_KEY + '/' + id + '/';\n\n // delete specific key in the storage\n if( key )\n localStorage.removeItem(base + key)\n\n // delete all keys in the storage with a specific tagify id\n else {\n for(let k in localStorage)\n if( k.includes(base) )\n localStorage.removeItem(k)\n }\n}\n", "export default {\r\n empty : \"empty\",\r\n exceed : \"number of tags exceeded\",\r\n pattern : \"pattern mismatch\",\r\n duplicate : \"already exists\",\r\n notAllowed : \"not allowed\"\r\n}", "import {ZERO_WIDTH_UNICODE_CHAR} from './constants'\n\nexport default {\n /**\n *\n * @param {DOM Object} input Original input DOm element\n * @param {Object} settings Tagify instance settings Object\n */\n wrapper(input, _s){\n return `<tags class=\"${_s.classNames.namespace} ${_s.mode ? `${_s.classNames[_s.mode + \"Mode\"]}` : \"\"} ${input.className}\"\n ${_s.readonly ? 'readonly' : ''}\n ${_s.disabled ? 'disabled' : ''}\n ${_s.required ? 'required' : ''}\n ${_s.mode === 'select' ? \"spellcheck='false'\" : ''}\n tabIndex=\"-1\">\n ${this.settings.templates.input.call(this)}\n ${ZERO_WIDTH_UNICODE_CHAR}\n </tags>`\n },\n\n input() {\n var _s = this.settings,\n placeholder = _s.placeholder || ZERO_WIDTH_UNICODE_CHAR;\n\n return `<span ${!_s.readonly && _s.userInput ? 'contenteditable' : ''} tabIndex=\"0\" data-placeholder=\"${placeholder}\" aria-placeholder=\"${_s.placeholder || ''}\"\n class=\"${_s.classNames.input}\"\n role=\"textbox\"\n autocapitalize=\"false\"\n autocorrect=\"off\"\n aria-autocomplete=\"both\"\n aria-multiline=\"${_s.mode=='mix'?true:false}\"></span>`\n },\n\n tag(tagData, {settings: _s}){\n return `<tag title=\"${(tagData.title || tagData.value)}\"\n contenteditable='false'\n tabIndex=\"${_s.a11y.focusableTags ? 0 : -1}\"\n class=\"${_s.classNames.tag} ${tagData.class || \"\"}\"\n ${this.getAttributes(tagData)}>\n <x title='' tabIndex=\"${_s.a11y.focusableTags ? 0 : -1}\" class=\"${_s.classNames.tagX}\" role='button' aria-label='remove tag'></x>\n <div>\n <span ${_s.mode === 'select' && _s.userInput ? \"contenteditable='true'\" : ''} autocapitalize=\"false\" autocorrect=\"off\" spellcheck='false' class=\"${_s.classNames.tagText}\">${tagData[_s.tagTextProp] || tagData.value}</span>\n </div>\n </tag>`\n },\n\n dropdown(settings){\n var _sd = settings.dropdown,\n isManual = _sd.position == 'manual';\n\n return `<div class=\"${isManual ? '' : settings.classNames.dropdown } ${_sd.classname}\" role=\"listbox\" aria-labelledby=\"dropdown\" dir=\"${_sd.RTL ? 'rtl' : ''}\">\n <div data-selector='tagify-suggestions-wrapper' class=\"${settings.classNames.dropdownWrapper}\"></div>\n </div>`\n },\n\n dropdownContent(HTMLContent) {\n var _t = this.settings.templates,\n suggestions = this.state.dropdown.suggestions;\n\n return `\n ${_t.dropdownHeader.call(this, suggestions)}\n ${HTMLContent}\n ${_t.dropdownFooter.call(this, suggestions)}\n `\n },\n\n dropdownItem(item){\n return `<div ${this.getAttributes(item)}\n class='${this.settings.classNames.dropdownItem} ${this.isTagDuplicate(item.value) ? this.settings.classNames.dropdownItemSelected: \"\"} ${item.class || \"\"}'\n tabindex=\"0\"\n role=\"option\">${item.mappedValue || item.value}</div>`\n },\n\n /**\n * @param {Array} suggestions An array of all the matched suggested items, including those which were sliced away due to the \"dropdown.maxItems\" setting\n */\n dropdownHeader(suggestions){\n return `<header data-selector='tagify-suggestions-header' class=\"${this.settings.classNames.dropdownHeader}\"></header>`\n },\n\n dropdownFooter(suggestions){\n var hasMore = suggestions.length - this.settings.dropdown.maxItems;\n\n return hasMore > 0\n ? `<footer data-selector='tagify-suggestions-footer' class=\"${this.settings.classNames.dropdownFooter}\">\n ${hasMore} more items. Refine your search.\n </footer>`\n : '';\n },\n\n dropdownItemNoMatch: null\n}\n", "import { decode, extend, getfirstTextNode, isChromeAndroidBrowser, isNodeTag, isWithinNodeTag, injectAtCaret, getSetTagData, fixCaretBetweenTags, placeCaretAfterNode } from './helpers'\nimport {ZERO_WIDTH_CHAR} from './constants'\n\nexport function triggerChangeEvent(){\n if( this.settings.mixMode.integrated ) return;\n\n var inputElm = this.DOM.originalInput,\n changed = this.state.lastOriginalValueReported !== inputElm.value,\n event = new CustomEvent(\"change\", {bubbles: true}); // must use \"CustomEvent\" and not \"Event\" to support IE\n\n if( !changed ) return;\n\n // must apply this BEFORE triggering the simulated event\n this.state.lastOriginalValueReported = inputElm.value\n\n // React hack: https://github.com/facebook/react/issues/11488\n event.simulated = true\n if (inputElm._valueTracker)\n inputElm._valueTracker.setValue(Math.random())\n\n inputElm.dispatchEvent(event)\n\n // also trigger a Tagify event\n this.trigger(\"change\", this.state.lastOriginalValueReported)\n\n // React, for some reason, clears the input's value after \"dispatchEvent\" is fired\n inputElm.value = this.state.lastOriginalValueReported\n}\n\nexport default {\n // bind custom events which were passed in the settings\n customBinding(){\n this.customEventsList.forEach(name => {\n this.on(name, this.settings.callbacks[name])\n })\n },\n\n binding( bindUnbind = true ){\n var _s = this.settings,\n _CB = this.events.callbacks,\n _CBR,\n action = bindUnbind ? 'addEventListener' : 'removeEventListener';\n\n // do not allow the main events to be bound more than once\n if( this.state.mainEvents && bindUnbind )\n return;\n\n // set the binding state of the main events, so they will not be bound more than once\n this.state.mainEvents = bindUnbind;\n\n // everything inside gets executed only once-per instance\n if( bindUnbind && !this.listeners.main ){\n this.events.bindGlobal.call(this);\n\n if( this.settings.isJQueryPlugin )\n jQuery(this.DOM.originalInput).on('tagify.removeAllTags', this.removeAllTags.bind(this))\n }\n\n // setup callback references so events could be removed later\n _CBR = (this.listeners.main = this.listeners.main || {\n keydown : ['input', _CB.onKeydown.bind(this)],\n click : ['scope', _CB.onClickScope.bind(this)],\n dblclick : _s.mode != 'select' && ['scope', _CB.onDoubleClickScope.bind(this)],\n paste : ['input', _CB.onPaste.bind(this)],\n drop : ['input', _CB.onDrop.bind(this)],\n compositionstart : ['input', _CB.onCompositionStart.bind(this)],\n compositionend : ['input', _CB.onCompositionEnd.bind(this)]\n })\n\n for( var eventName in _CBR ){\n _CBR[eventName] && this.DOM[_CBR[eventName][0]][action](eventName, _CBR[eventName][1]);\n }\n\n // observers\n var inputMutationObserver = this.listeners.main.inputMutationObserver || new MutationObserver(_CB.onInputDOMChange.bind(this));\n\n // cleaup just-in-case\n inputMutationObserver.disconnect()\n\n // observe stuff\n if( _s.mode == 'mix' ) {\n inputMutationObserver.observe(this.DOM.input, {childList:true})\n }\n\n this.events.bindOriginaInputListener.call(this)\n },\n\n bindOriginaInputListener(delay) {\n const DELAY = (delay||0) + 500\n\n if(!this.listeners.main) return\n // listen to original input changes (unfortunetly this is the best way...)\n // https://stackoverflow.com/a/1949416/104380\n clearInterval(this.listeners.main.originalInputValueObserverInterval)\n this.listeners.main.originalInputValueObserverInterval = setInterval(this.events.callbacks.observeOriginalInputValue.bind(this), DELAY)\n },\n\n bindGlobal( unbind ) {\n var _CB = this.events.callbacks,\n action = unbind ? 'removeEventListener' : 'addEventListener',\n e;\n\n if( !this.listeners || (!unbind && this.listeners.global) ) return; // do not re-bind\n\n // these events are global and should never be unbinded, unless the instance is destroyed:\n this.listeners.global = this.listeners.global || [\n {\n type: this.isIE ? 'keydown' : 'input', // IE cannot register \"input\" events on contenteditable elements, so the \"keydown\" should be used instead..\n target: this.DOM.input,\n cb: _CB[this.isIE ? 'onInputIE' : 'onInput'].bind(this)\n },\n {\n type: 'keydown',\n target: window,\n cb: _CB.onWindowKeyDown.bind(this)\n },\n {\n type: 'focusin',\n target: this.DOM.scope,\n cb: _CB.onFocusBlur.bind(this)\n },\n {\n type: 'focusout',\n target: this.DOM.scope,\n cb: _CB.onFocusBlur.bind(this)\n },\n {\n type: 'click',\n target: document,\n cb: _CB.onClickAnywhere.bind(this),\n useCapture: true\n },\n ]\n\n for( e of this.listeners.global )\n e.target[action](e.type, e.cb, !!e.useCapture);\n },\n\n unbindGlobal() {\n this.events.bindGlobal.call(this, true);\n },\n\n /**\n * DOM events callbacks\n */\n callbacks : {\n onFocusBlur(e){\n // when focusing within a tag which is in edit-mode\n var _s = this.settings,\n nodeTag = isWithinNodeTag.call(this, e.relatedTarget),\n targetIsTagNode = isNodeTag.call(this, e.relatedTarget),\n isTargetXBtn = e.target.classList.contains(_s.classNames.tagX),\n isFocused = e.type == 'focusin',\n lostFocus = e.type == 'focusout';\n\n // when focusing within a tag which is in edit-mode, only and specifically on the text-part of the tag node\n // and not the X button or any other custom element thatmight be there\n // var tagTextNode = e.target?.closest(this.settings.classNames.tagTextSelector)\n\n if(isTargetXBtn && _s.mode != 'mix') {\n this.DOM.input.focus()\n }\n\n if( nodeTag && isFocused && (!targetIsTagNode) && !isTargetXBtn) {\n this.toggleFocusClass(this.state.hasFocus = +new Date())\n\n // only if focused within a tag's text node should the `onEditTagFocus` function be called.\n // if clicked anywhere else inside a tag, which had triggered an `focusin` event,\n // the onFocusBlur should be aborted. This part was spcifically written for `select` mode.\n // tagTextNode && this.events.callbacks.onEditTagFocus.call(this, nodeTag)\n }\n\n var text = e.target ? this.trim(this.DOM.input.textContent) : '', // a string\n currentDisplayValue = this.value?.[0]?.[_s.tagTextProp],\n ddEnabled = _s.dropdown.enabled >= 0,\n eventData = {relatedTarget:e.relatedTarget},\n isTargetSelectOption = this.state.actions.selectOption && (ddEnabled || !_s.dropdown.closeOnSelect),\n isTargetAddNewBtn = this.state.actions.addNew && ddEnabled,\n shouldAddTags;\n\n if( lostFocus ){\n if( e.relatedTarget === this.DOM.scope ){\n this.dropdown.hide()\n this.DOM.input.focus()\n return\n }\n\n this.postUpdate()\n _s.onChangeAfterBlur && this.triggerChangeEvent()\n }\n\n if( isTargetSelectOption || isTargetAddNewBtn || isTargetXBtn ) {\n return;\n }\n\n // should only loose focus at this point if the event was not generated from within a tag\n if( isFocused || nodeTag ) {\n this.state.hasFocus = +new Date()\n }\n else {\n this.state.hasFocus = false;\n }\n\n this.toggleFocusClass(this.state.hasFocus)\n\n if( _s.mode == 'mix' ){\n if( isFocused ){\n this.trigger(\"focus\", eventData)\n }\n\n else if( lostFocus ){\n this.trigger(\"blur\", eventData)\n this.loading(false)\n this.dropdown.hide()\n // reset state which needs reseting\n this.state.dropdown.visible = undefined\n this.setStateSelection()\n }\n\n return\n }\n\n if( isFocused ){\n if( !_s.focusable ) return;\n\n var dropdownCanBeShown = _s.dropdown.enabled === 0 && !this.state.dropdown.visible,\n condition2 = !targetIsTagNode || _s.mode === 'select',\n tagText = this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector)\n\n this.trigger(\"focus\", eventData)\n // e.target.classList.remove('placeholder');\n if( dropdownCanBeShown && condition2 ){ // && _s.mode != \"select\"\n this.dropdown.show(this.value.length ? '' : undefined)\n this.setRangeAtStartEnd(false, tagText)\n }\n\n return\n }\n\n else if( lostFocus ){\n this.trigger(\"blur\", eventData)\n this.loading(false)\n\n // when clicking the X button of a selected tag, it is unwanted for it to be added back\n // again in a few more lines of code (shouldAddTags && addTags)\n if( _s.mode == 'select' ) {\n if( this.value.length ) {\n let firstTagNode = this.getTagElms()[0];\n text = this.trim(firstTagNode.textContent)\n }\n\n // if nothing has changed (same display value), do not add a tag\n if( currentDisplayValue === text )\n text = ''\n }\n\n shouldAddTags = text && !this.state.actions.selectOption && _s.addTagOnBlur && _s.addTagOn.includes('blur');\n // do not add a tag if \"selectOption\" action was just fired (this means a tag was just added from the dropdown)\n shouldAddTags && this.addTags(text, true)\n }\n\n // when clicking a tag, do not consider this is a \"blur\" event\n if ( !nodeTag ) {\n this.DOM.input.removeAttribute('style')\n this.dropdown.hide()\n }\n },\n\n onCompositionStart(e){\n this.state.composing = true\n },\n\n onCompositionEnd(e){\n this.state.composing = false\n },\n\n onWindowKeyDown(e){\n var _s = this.settings,\n focusedElm = document.activeElement,\n withinTag = isWithinNodeTag.call(this, focusedElm),\n isBelong = withinTag && this.DOM.scope.contains(focusedElm),\n isInputNode = focusedElm === this.DOM.input,\n isReadyOnlyTag = isBelong && focusedElm.hasAttribute('readonly'),\n tagText = this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector),\n isDropdownVisible = this.state.dropdown.visible,\n nextTag;\n\n if( !(e.key === 'Tab' && isDropdownVisible) && !this.state.hasFocus && (!isBelong || isReadyOnlyTag) || isInputNode ) return;\n\n nextTag = focusedElm.nextElementSibling;\n\n var targetIsRemoveBtn = e.target.classList.contains(_s.classNames.tagX);\n\n switch( e.key ){\n // remove tag if has focus\n case 'Backspace': {\n if( !_s.readonly && !this.state.editing ) {\n this.removeTags(focusedElm);\n (nextTag ? nextTag : this.DOM.input).focus()\n }\n\n break;\n }\n\n case 'Enter': {\n if( targetIsRemoveBtn ) {\n this.removeTags( e.target.parentNode )\n return\n }\n\n if( _s.a11y.focusableTags && isNodeTag.call(this, focusedElm) )\n setTimeout(this.editTag.bind(this), 0, focusedElm)\n\n break;\n }\n\n case 'ArrowDown' : {\n // if( _s.mode == 'select' ) // issue #333\n if( !this.state.dropdown.visible && _s.mode != 'mix' )\n this.dropdown.show()\n break;\n }\n\n case 'Tab': {\n tagText?.focus();\n break;\n }\n }\n },\n\n onKeydown(e){\n var _s = this.settings;\n\n // ignore keys during IME composition or when user input is not allowed\n if( this.state.composing || !_s.userInput )\n return\n\n if( _s.mode == 'select' && _s.enforceWhitelist && this.value.length && e.key != 'Tab' ){\n e.preventDefault()\n }\n\n var s = this.trim(e.target.textContent);\n\n this.trigger(\"keydown\", {event:e})\n\n _s.hooks.beforeKeyDown(e, {tagify:this})\n .then(result => {\n /**\n * ONLY FOR MIX-MODE:\n */\n if( _s.mode == 'mix' ){\n switch( e.key ){\n case 'Left' :\n case 'ArrowLeft' : {\n // when left arrow was pressed, set a flag so when the dropdown is shown, right-arrow will be ignored\n // because it seems likely the user wishes to use the arrows to move the caret\n this.state.actions.ArrowLeft = true\n break\n }\n\n case 'Delete':\n case 'Backspace' : {\n if( this.state.editing ) return\n\n var sel = document.getSelection(),\n deleteKeyTagDetected = e.key == 'Delete' && sel.anchorOffset == (sel.anchorNode.length || 0),\n prevAnchorSibling = sel.anchorNode.previousSibling,\n isCaretAfterTag = sel.anchorNode.nodeType == 1 || !sel.anchorOffset && prevAnchorSibling && prevAnchorSibling.nodeType == 1 && sel.anchorNode.previousSibling,\n lastInputValue = decode(this.DOM.input.innerHTML),\n lastTagElems = this.getTagElms(),\n isZWS = sel.anchorNode.length === 1 && sel.anchorNode.nodeValue == String.fromCharCode(8203),\n // isCaretInsideTag = sel.anchorNode.parentNode('.' + _s.classNames.tag),\n tagBeforeCaret,\n tagElmToBeDeleted,\n firstTextNodeBeforeTag;\n\n if( _s.backspace == 'edit' && isCaretAfterTag ){\n tagBeforeCaret = sel.anchorNode.nodeType == 1 ? null : sel.anchorNode.previousElementSibling;\n setTimeout(this.editTag.bind(this), 0, tagBeforeCaret); // timeout is needed to the last cahacrter in the edited tag won't get deleted\n e.preventDefault() // needed so the tag elm won't get deleted\n return;\n }\n\n if( isChromeAndroidBrowser() && isCaretAfterTag instanceof Element ){\n firstTextNodeBeforeTag = getfirstTextNode(isCaretAfterTag)\n\n if( !isCaretAfterTag.hasAttribute('readonly') )\n isCaretAfterTag.remove() // since this is Chrome, can safetly use this \"new\" DOM API\n\n // Android-Chrome wrongly hides the keyboard, and loses focus,\n // so this hack below is needed to regain focus at the correct place:\n this.DOM.input.focus()\n setTimeout(() => {\n placeCaretAfterNode(firstTextNodeBeforeTag)\n this.DOM.input.click()\n\n })\n\n return\n }\n\n if( sel.anchorNode.nodeName == 'BR')\n return\n\n if( (deleteKeyTagDetected || isCaretAfterTag) && sel.anchorNode.nodeType == 1 )\n if( sel.anchorOffset == 0 ) // caret is at the very begining, before a tag\n tagElmToBeDeleted = deleteKeyTagDetected // delete key pressed\n ? lastTagElems[0]\n : null;\n else\n tagElmToBeDeleted = lastTagElems[Math.min(lastTagElems.length, sel.anchorOffset) - 1]\n\n // find out if a tag *might* be a candidate for deletion, and if so, which\n else if( deleteKeyTagDetected )\n tagElmToBeDeleted = sel.anchorNode.nextElementSibling;\n\n else if( isCaretAfterTag instanceof Element )\n tagElmToBeDeleted = isCaretAfterTag;\n\n // tagElm.hasAttribute('readonly')\n if( sel.anchorNode.nodeType == 3 && // node at caret location is a Text node\n !sel.anchorNode.nodeValue && // has some text\n sel.anchorNode.previousElementSibling ) // text node has a Tag node before it\n e.preventDefault()\n\n // if backspace not allowed, do nothing\n // TODO: a better way to detect if nodes were deleted is to simply check the \"this.value\" before & after\n if( (isCaretAfterTag || deleteKeyTagDetected) && !_s.backspace ){\n e.preventDefault()\n return\n }\n\n if( sel.type != 'Range' && !sel.anchorOffset && sel.anchorNode == this.DOM.input && e.key != 'Delete' ){\n e.preventDefault()\n return\n }\n\n if( sel.type != 'Range' && tagElmToBeDeleted && tagElmToBeDeleted.hasAttribute('readonly') ){\n // allows the continuation of deletion by placing the caret on the first previous textNode.\n // since a few readonly-tags might be one after the other, iteration is needed:\n\n placeCaretAfterNode( getfirstTextNode(tagElmToBeDeleted) )\n return\n }\n\n if ( e.key == 'Delete' && isZWS && getSetTagData(sel.anchorNode.nextSibling) ) {\n this.removeTags(sel.anchorNode.nextSibling)\n }\n\n // update regarding https://github.com/yairEO/tagify/issues/762#issuecomment-786464317:\n // the bug described is more severe than the fix below, therefore I disable the fix until a solution\n // is found which work well for both cases.\n // -------\n // nodeType is \"1\" only when the caret is at the end after last tag (no text after), or before first first (no text before)\n /*\n if( this.isFirefox && sel.anchorNode.nodeType == 1 && sel.anchorOffset != 0 ){\n this.removeTags() // removes last tag by default if no parameter supplied\n // place caret inside last textNode, if exist. it's an annoying bug only in FF,\n // if the last tag is removed, and there is a textNode before it, the caret is not placed at its end\n placeCaretAfterNode( setRangeAtStartEnd(false, this.DOM.input) )\n }\n */\n\n break;\n }\n // currently commented to allow new lines in mixed-mode\n // case 'Enter' :\n // // e.preventDefault(); // solves Chrome bug - http://stackoverflow.com/a/20398191/104380\n }\n\n return true\n }\n\n var isManualDropdown = _s.dropdown.position == 'manual';\n\n switch( e.key ){\n case 'Backspace' :\n if( _s.mode == 'select' && _s.enforceWhitelist && this.value.length)\n this.removeTags()\n\n else if( !this.state.dropdown.visible || _s.dropdown.position == 'manual' ){\n if( e.target.textContent == \"\" || s.charCodeAt(0) == 8203 ){ // 8203: ZERO WIDTH SPACE unicode\n if( _s.backspace === true )\n this.removeTags()\n else if( _s.backspace == 'edit' )\n setTimeout(this.editTag.bind(this), 0) // timeout reason: when edited tag gets focused and the caret is placed at the end, the last character gets deletec (because of backspace)\n }\n }\n break;\n\n case 'Esc' :\n case 'Escape' :\n if( this.state.dropdown.visible ) return\n e.target.blur()\n break;\n\n case 'Down' :\n case 'ArrowDown' :\n // if( _s.mode == 'select' ) // issue #333\n if( !this.state.dropdown.visible )\n this.dropdown.show()\n break;\n\n case 'ArrowRight' : {\n let tagData = this.state.inputSuggestion || this.state.ddItemData\n if( tagData && _s.autoComplete.rightKey ){\n this.addTags([tagData], true)\n return;\n }\n break\n }\n\n case 'Tab' : {\n return true;\n }\n\n case 'Enter' :\n // manual suggestion boxes are assumed to always be visible\n if( this.state.dropdown.visible && !isManualDropdown ) return\n e.preventDefault(); // solves Chrome bug - http://stackoverflow.com/a/20398191/104380\n // because the main \"keydown\" event is bound before the dropdown events, this will fire first and will not *yet*\n // know if an option was just selected from the dropdown menu. If an option was selected,\n // the dropdown events should handle adding the tag\n\n var thingToAdd = this.state.autoCompleteData || s;\n\n setTimeout(()=>{\n if( (!this.state.dropdown.visible || isManualDropdown) && !this.state.actions.selectOption && _s.addTagOn.includes(e.key.toLowerCase()) ) {\n this.addTags([thingToAdd], true)\n this.state.autoCompleteData = null\n }\n })\n }\n })\n .catch(err => err)\n },\n\n onInput(e){\n this.postUpdate() // toggles \"tagify--empty\" class\n\n var _s = this.settings;\n\n if( _s.mode == 'mix' )\n return this.events.callbacks.onMixTagsInput.call(this, e);\n\n var value = this.input.normalize.call(this, undefined, {trim: false}),\n showSuggestions = value.length >= _s.dropdown.enabled,\n eventData = {value, inputElm:this.DOM.input},\n validation = this.validateTag({value});\n\n if( _s.mode == 'select' ) {\n this.toggleScopeValidation(validation)\n }\n\n eventData.isValid = validation;\n\n // for IE; since IE doesn't have an \"input\" event so \"keyDown\" is used instead to trigger the \"onInput\" callback,\n // and so many keys do not change the input, and for those do not continue.\n if( this.state.inputText == value ) return;\n\n // save the value on the input's State object\n this.input.set.call(this, value, false); // update the input with the normalized value and run validations\n // this.setRangeAtStartEnd(false, this.DOM.input); // fix caret position\n\n // if delimiters detected, add tags\n if( value.search(_s.delimiters) != -1 ){\n if( this.addTags( value ) ){\n this.input.set.call(this); // clear the input field's value\n }\n }\n\n else if( _s.dropdown.enabled >= 0 ){\n this.dropdown[showSuggestions ? \"show\" : \"hide\"](value);\n }\n\n this.trigger('input', eventData) // \"input\" event must be triggered at this point, before the dropdown is shown\n },\n\n onMixTagsInput( e ){\n var rangeText, match, matchedPatternCount, tag, showSuggestions, selection,\n _s = this.settings,\n lastTagsCount = this.value.length,\n matchFlaggedTag,\n matchDelimiters,\n tagsElems = this.getTagElms(),\n fragment = document.createDocumentFragment(),\n range = window.getSelection().getRangeAt(0),\n remainingTagsValues = [].map.call(tagsElems, node => getSetTagData(node).value);\n\n // Android Chrome \"keydown\" event argument does not report the correct \"key\".\n // this workaround is needed to manually call \"onKeydown\" method with a synthesized event object\n if( e.inputType == \"deleteContentBackward\" && isChromeAndroidBrowser() ){\n this.events.callbacks.onKeydown.call(this, {\n target: e.target,\n key: \"Backspace\",\n })\n }\n\n // if there's a tag as the first child of the input, always make sure it has a zero-width character before it\n // or if two tags are next to each-other, add a zero-space width character (For the caret to appear)\n fixCaretBetweenTags(this.getTagElms())\n\n // re-add \"readonly\" tags which might have been removed\n this.value.slice().forEach(item => {\n if( item.readonly && !remainingTagsValues.includes(item.value) )\n fragment.appendChild( this.createTagElem(item) )\n })\n\n if( fragment.childNodes.length ){\n range.insertNode(fragment)\n this.setRangeAtStartEnd(false, fragment.lastChild)\n }\n\n // check if tags were \"magically\" added/removed (browser redo/undo or CTRL-A -> delete)\n if( tagsElems.length != lastTagsCount ){\n this.value = [].map.call(this.getTagElms(), node => getSetTagData(node))\n this.update({ withoutChangeEvent:true })\n return\n }\n\n if( this.hasMaxTags() )\n return true\n\n if( window.getSelection ){\n selection = window.getSelection()\n\n // only detect tags if selection is inside a textNode (not somehow on already-existing tag)\n if( selection.rangeCount > 0 && selection.anchorNode.nodeType == 3 ){\n range = selection.getRangeAt(0).cloneRange()\n range.collapse(true)\n range.setStart(selection.focusNode, 0)\n\n rangeText = range.toString().slice(0, range.endOffset) // slice the range so everything AFTER the caret will be trimmed\n // split = range.toString().split(_s.mixTagsAllowedAfter) // [\"foo\", \"bar\", \"@baz\"]\n matchedPatternCount = rangeText.split(_s.pattern).length - 1;\n\n match = rangeText.match( _s.pattern )\n\n if( match )\n // tag string, example: \"@aaa ccc\"\n tag = rangeText.slice( rangeText.lastIndexOf(match[match.length-1]) )\n\n if( tag ){\n this.state.actions.ArrowLeft = false // start fresh, assuming the user did not (yet) used any arrow to move the caret\n this.state.tag = {\n prefix : tag.match(_s.pattern)[0],\n value : tag.replace(_s.pattern, ''), // get rid of the prefix\n }\n this.state.tag.baseOffset = selection.baseOffset - this.state.tag.value.length\n\n matchDelimiters = this.state.tag.value.match(_s.delimiters)\n // if a delimeter exists, add the value as tag (exluding the delimiter)\n if( matchDelimiters ){\n this.state.tag.value = this.state.tag.value.replace(_s.delimiters, '')\n this.state.tag.delimiters = matchDelimiters[0]\n this.addTags(this.state.tag.value, _s.dropdown.clearOnSelect)\n this.dropdown.hide()\n return\n }\n\n showSuggestions = this.state.tag.value.length >= _s.dropdown.enabled\n\n // When writing something that might look like a tag (an email address) but isn't one - it is unwanted\n // the suggestions dropdown be shown, so the user can close it (in any way), and while continue typing,\n // dropdown should stay closed until another tag is typed.\n // if( this.state.tag.value.length && this.state.dropdown.visible === false )\n // showSuggestions = false\n\n // test for similar flagged tags to the current tag\n\n try{\n matchFlaggedTag = this.state.flaggedTags[this.state.tag.baseOffset]\n matchFlaggedTag = matchFlaggedTag.prefix == this.state.tag.prefix &&\n matchFlaggedTag.value[0] == this.state.tag.value[0]\n\n // reset\n if( this.state.flaggedTags[this.state.tag.baseOffset] && !this.state.tag.value )\n delete this.state.flaggedTags[this.state.tag.baseOffset];\n }\n catch(err){}\n\n // scenario: (do not show suggestions of another matched tag, if more than one detected)\n // (2 tags exist) \" a@a.com and @\"\n // (second tag is removed by backspace) \" a@a.com and \"\n if( matchFlaggedTag || matchedPatternCount < this.state.mixMode.matchedPatternCount )\n showSuggestions = false\n }\n // no (potential) tag found\n else{\n this.state.flaggedTags = {}\n }\n\n this.state.mixMode.matchedPatternCount = matchedPatternCount\n }\n }\n\n\n // wait until the \"this.value\" has been updated (see \"onKeydown\" method for \"mix-mode\")\n // the dropdown must be shown only after this event has been triggered, so an implementer could\n // dynamically change the whitelist.\n setTimeout(()=>{\n this.update({withoutChangeEvent:true})\n this.trigger('input', extend({}, this.state.tag, {textContent:this.DOM.input.textContent}))\n\n if( this.state.tag )\n this.dropdown[showSuggestions ? \"show\" : \"hide\"](this.state.tag.value);\n }, 10)\n },\n\n onInputIE(e){\n var _this = this;\n // for the \"e.target.textContent\" to be changed, the browser requires a small delay\n setTimeout(function(){\n _this.events.callbacks.onInput.call(_this, e)\n })\n },\n\n observeOriginalInputValue(){\n // if, for some reason, the Tagified element is no longer in the DOM,\n // call the \"destroy\" method to kill all references to timeouts/intervals\n if( !this.DOM.originalInput.parentNode ) this.destroy()\n\n // if original input value changed for some reason (for exmaple a form reset)\n if( this.DOM.originalInput.value != this.DOM.originalInput.tagifyValue )\n this.loadOriginalValues()\n },\n\n onClickAnywhere(e){\n if (e.target != this.DOM.scope && !this.DOM.scope.contains(e.target)) {\n this.toggleFocusClass(false)\n this.state.hasFocus = false\n\n let closestTagifyDropdownElem = e.target.closest(this.settings.classNames.dropdownSelector);\n\n // do not hide the dropdown if a click was initiated within it and that dropdown belongs to this Tagify instance\n if( closestTagifyDropdownElem?.__tagify != this )\n this.dropdown.hide()\n }\n },\n\n onClickScope(e){\n var _s = this.settings,\n tagElm = e.target.closest('.' + _s.classNames.tag),\n isScope = e.target === this.DOM.scope,\n timeDiffFocus = +new Date() - this.state.hasFocus;\n\n if( isScope && _s.mode != 'select' ){\n // if( !this.state.hasFocus )\n this.DOM.input.focus()\n return\n }\n\n else if( e.target.classList.contains(_s.classNames.tagX) ){\n this.removeTags( e.target.parentNode )\n return\n }\n\n else if( tagElm && !this.state.editing ){\n this.trigger(\"click\", { tag:tagElm, index:this.getNodeIndex(tagElm), data:getSetTagData(tagElm), event:e })\n\n if( _s.editTags === 1 || _s.editTags.clicks === 1 || _s.mode == 'select' )\n this.events.callbacks.onDoubleClickScope.call(this, e)\n\n return\n }\n\n // when clicking on the input itself\n else if( e.target == this.DOM.input ){\n if( _s.mode == 'mix' ){\n // firefox won't show caret if last element is a tag (and not a textNode),\n // so an empty textnode should be added\n this.fixFirefoxLastTagNoCaret()\n }\n\n if( timeDiffFocus > 500 || !_s.focusable ){\n if( this.state.dropdown.visible )\n this.dropdown.hide()\n else if( _s.dropdown.enabled === 0 && _s.mode != 'mix' )\n this.dropdown.show(this.value.length ? '' : undefined)\n return\n }\n }\n\n if( _s.mode == 'select' && _s.dropdown.enabled === 0 && !this.state.dropdown.visible) {\n this.events.callbacks.onDoubleClickScope.call(this, {...e, target: this.getTagElms()[0]})\n\n !_s.userInput && this.dropdown.show()\n }\n },\n\n // special proccess is needed for pasted content in order to \"clean\" it\n onPaste(e){\n e.preventDefault()\n\n var tagsElems,\n _s = this.settings;\n\n if( !_s.userInput ){\n return false;\n }\n\n var clipboardData, pastedText;\n\n if( _s.readonly ) return\n\n // Get pasted data via clipboard API\n clipboardData = e.clipboardData || window.clipboardData\n pastedText = clipboardData.getData('Text')\n\n _s.hooks.beforePaste(e, {tagify:this, pastedText, clipboardData})\n .then(result => {\n if( result === undefined )\n result = pastedText;\n\n if( result ){\n this.injectAtCaret(result, window.getSelection().getRangeAt(0))\n\n if( this.settings.mode == 'mix' ){\n this.events.callbacks.onMixTagsInput.call(this, e);\n }\n\n else if( this.settings.pasteAsTags ){\n tagsElems = this.addTags(this.state.inputText + result, true)\n }\n\n else {\n this.state.inputText = result\n this.dropdown.show(result)\n }\n }\n\n this.trigger('paste', {event: e, pastedText, clipboardData, tagsElems})\n })\n .catch(err => err)\n },\n\n onDrop(e){\n e.preventDefault()\n },\n\n onEditTagInput( editableElm, e ){\n var tagElm = editableElm.closest('.' + this.settings.classNames.tag),\n tagElmIdx = this.getNodeIndex(tagElm),\n tagData = getSetTagData(tagElm),\n textValue = this.input.normalize.call(this, editableElm),\n dataForChangedProp = {[this.settings.tagTextProp]: textValue, __tagId: tagData.__tagId}, // \"__tagId\" is needed so validation will skip current tag when checking for dups\n isValid = this.validateTag(dataForChangedProp), // the value could have been invalid in the first-place so make sure to re-validate it (via \"addEmptyTag\" method)\n hasChanged = this.editTagChangeDetected(extend(tagData, dataForChangedProp));\n\n // if the value is same as before-editing and the tag was valid before as well, ignore the current \"isValid\" result, which is false-positive\n if( !hasChanged && editableElm.originalIsValid === true )\n isValid = true\n\n tagElm.classList.toggle(this.settings.classNames.tagInvalid, isValid !== true)\n tagData.__isValid = isValid\n\n tagElm.title = isValid === true\n ? tagData.title || tagData.value\n : isValid // change the tag's title to indicate why is the tag invalid (if it's so)\n\n // show dropdown if typed text is equal or more than the \"enabled\" dropdown setting\n if( textValue.length >= this.settings.dropdown.enabled ){\n // this check is needed apparently because doing browser \"undo\" will fire\n // \"onEditTagInput\" but \"this.state.editing\" will be \"false\"\n if( this.state.editing )\n this.state.editing.value = textValue\n this.dropdown.show(textValue)\n }\n\n this.trigger(\"edit:input\", {\n tag : tagElm,\n index: tagElmIdx,\n data : extend({}, this.value[tagElmIdx], {newValue:textValue}),\n event: e\n })\n },\n\n onEditTagPaste( tagElm, e ){\n // Get pasted data via clipboard API\n var clipboardData = e.clipboardData || window.clipboardData,\n pastedText = clipboardData.getData('Text');\n\n e.preventDefault()\n\n var newNode = injectAtCaret(pastedText)\n this.setRangeAtStartEnd(false, newNode)\n },\n\n onEditTagClick( tagElm, e) {\n this.events.callbacks.onClickScope.call(this, e)\n },\n\n onEditTagFocus( tagElm ){\n this.state.editing = {\n scope: tagElm,\n input: tagElm.querySelector(\"[contenteditable]\")\n }\n },\n\n onEditTagBlur( editableElm, e ){\n // if \"relatedTarget\" is the tag then do not continue as this should not be considered a \"blur\" event\n var isRelatedTargetNodeTag = isNodeTag.call(this, e.relatedTarget)\n\n // in \"select-mode\" when editing the tag's template to include more nodes other than the editable \"span\",\n // clicking those elements should not be considered a blur event\n if( this.settings.mode == 'select' && isRelatedTargetNodeTag && e.relatedTarget.contains(e.target) ) {\n this.dropdown.hide()\n return\n }\n\n // if \"ESC\" key was pressed then the \"editing\" state should be `false` and if so, logic should not continue\n // because \"ESC\" reverts the edited tag back to how it was (replace the node) before editing\n if( !this.state.editing )\n return;\n\n if( !this.state.hasFocus )\n this.toggleFocusClass()\n\n if(!this.DOM.scope.contains(document.activeElement)) {\n this.trigger(\"blur\", {})\n }\n\n // one scenario is when selecting a suggestion from the dropdown, when editing, and by selecting it\n // the \"onEditTagDone\" is called directly, already replacing the tag, so the argument \"editableElm\"\n // node isn't in the DOM anynmore because it has been replaced.\n if( !this.DOM.scope.contains(editableElm) ) return;\n\n var _s = this.settings,\n tagElm = editableElm.closest('.' + _s.classNames.tag),\n tagData = getSetTagData(tagElm),\n textValue = this.input.normalize.call(this, editableElm),\n dataForChangedProp = {[_s.tagTextProp]: textValue, __tagId: tagData.__tagId}, // \"__tagId\" is needed so validation will skip current tag when checking for dups\n originalData = tagData.__originalData, // pre-edit data\n hasChanged = this.editTagChangeDetected(extend(tagData, dataForChangedProp)),\n isValid = this.validateTag(dataForChangedProp), // \"__tagId\" is needed so validation will skip current tag when checking for dups\n hasMaxTags,\n newTagData;\n\n if( !textValue ){\n this.onEditTagDone(tagElm)\n return\n }\n\n // if nothing changed revert back to how it was before editing\n if( !hasChanged ){\n this.onEditTagDone(tagElm, originalData)\n return\n }\n\n // need to know this because if \"keepInvalidTags\" setting is \"true\" and an invalid tag is edited as a valid one,\n // but the maximum number of tags have alreay been reached, so it should not allow saving the new valid value.\n // only if the tag was already valid before editing, ignore this check (see a few lines below)\n hasMaxTags = this.hasMaxTags()\n\n newTagData = extend(\n {},\n originalData,\n {\n [_s.tagTextProp]: this.trim(textValue),\n __isValid: isValid\n }\n )\n\n // pass through optional transformer defined in settings\n _s.transformTag.call(this, newTagData, originalData)\n\n // MUST re-validate after tag transformation\n // only validate the \"tagTextProp\" because is the only thing that metters for validating an edited tag.\n // -- Scenarios: --\n // 1. max 3 tags allowd. there are 4 tags, one has invalid input and is edited to a valid one, and now should be marked as \"not allowed\" because limit of tags has reached\n // 2. max 3 tags allowed. there are 3 tags, one is edited, and so max-tags vaildation should be OK\n isValid = (!hasMaxTags || originalData.__isValid === true) && this.validateTag(newTagData)\n\n if( isValid !== true ){\n this.trigger(\"invalid\", { data:newTagData, tag:tagElm, message:isValid })\n\n // do nothing if invalid, stay in edit-mode until corrected or reverted by presssing esc\n if( _s.editTags.keepInvalid ) return\n\n if( _s.keepInvalidTags )\n newTagData.__isValid = isValid\n else\n // revert back if not specified to keep\n newTagData = originalData\n }\n\n else if( _s.keepInvalidTags ){\n // cleaup any previous leftovers if the tag was invalid\n delete newTagData.title\n delete newTagData[\"aria-invalid\"]\n delete newTagData.class\n }\n\n // tagElm.classList.toggle(_s.classNames.tagInvalid, true)\n\n this.onEditTagDone(tagElm, newTagData)\n },\n\n onEditTagkeydown(e, tagElm){\n // ignore keys during IME composition\n if( this.state.composing )\n return\n\n this.trigger(\"edit:keydown\", {event:e})\n\n switch( e.key ){\n case 'Esc' :\n case 'Escape' : {\n this.state.editing = false\n var hasValueToRevertTo = !!tagElm.__tagifyTagData.__originalData.value\n\n if( hasValueToRevertTo )\n // revert the tag to how it was before editing\n // replace current tag with original one (pre-edited one)\n tagElm.parentNode.replaceChild(tagElm.__tagifyTagData.__originalHTML, tagElm)\n else\n tagElm.remove()\n\n break\n }\n case 'Enter' :\n case 'Tab' : {\n e.preventDefault()\n\n var EDITED_TAG_BLUR_DELAY = 0;\n\n // a setTimeout is used so when editing (in \"select\" mode) while the dropdown is shown and a suggestion is highlighted\n // and ENTER key is pressed down - the `dropdown.hide` method won't be invoked immediately and unbind the dropdown's\n // KEYDOWN \"ENTER\" before it has time to call the handler and select the suggestion.\n setTimeout(() => e.target.blur(), EDITED_TAG_BLUR_DELAY)\n }\n }\n },\n\n onDoubleClickScope(e){\n var tagElm = e.target.closest('.' + this.settings.classNames.tag);\n\n if( !tagElm ) return\n\n var tagData = getSetTagData(tagElm),\n _s = this.settings,\n isEditingTag,\n isReadyOnlyTag;\n\n if( tagData?.editable === false ) return\n\n isEditingTag = tagElm.classList.contains(this.settings.classNames.tagEditing)\n isReadyOnlyTag = tagElm.hasAttribute('readonly')\n\n if( !_s.readonly && !isEditingTag && !isReadyOnlyTag && this.settings.editTags && _s.userInput ) {\n this.events.callbacks.onEditTagFocus.call(this, tagElm)\n this.editTag(tagElm)\n }\n\n this.toggleFocusClass(true)\n\n if( _s.mode != 'select' )\n this.trigger('dblclick', { tag:tagElm, index:this.getNodeIndex(tagElm), data:getSetTagData(tagElm) })\n },\n\n /**\n *\n * @param {Object} m an object representing the observed DOM changes\n */\n onInputDOMChange(m){\n // iterate all DOM mutation\n m.forEach(record => {\n // only the ADDED nodes\n record.addedNodes.forEach(addedNode => {\n // fix chrome's placing '<div><br></div>' everytime ENTER key is pressed, and replace with just `<br'\n if( addedNode.outerHTML == '<div><br></div>' ){\n addedNode.replaceWith(document.createElement('br'))\n }\n\n // if the added element is a div containing a tag within it (chrome does this when pressing ENTER before a tag)\n else if( addedNode.nodeType == 1 && addedNode.querySelector(this.settings.classNames.tagSelector) ){\n let newlineText = document.createTextNode('')\n\n if( addedNode.childNodes[0].nodeType == 3 && addedNode.previousSibling.nodeName != 'BR' )\n newlineText = document.createTextNode('\\n')\n\n // unwrap the useless div\n // chrome adds a BR at the end which should be removed\n addedNode.replaceWith(...[newlineText, ...[...addedNode.childNodes].slice(0,-1)])\n placeCaretAfterNode(newlineText)\n }\n\n // if this is a tag\n else if( isNodeTag.call(this, addedNode) ){\n if( addedNode.previousSibling?.nodeType == 3 && !addedNode.previousSibling.textContent )\n addedNode.previousSibling.remove()\n\n // and it is the first node in a new line\n if( addedNode.previousSibling && addedNode.previousSibling.nodeName == 'BR' ){\n // allows placing the caret just before the tag, when the tag is the first node in that line\n addedNode.previousSibling.replaceWith('\\n' + ZERO_WIDTH_CHAR)\n\n let nextNode = addedNode.nextSibling, anythingAfterNode = '';\n\n while (nextNode) {\n anythingAfterNode += nextNode.textContent\n nextNode = nextNode.nextSibling;\n }\n\n // when hitting ENTER for new line just before an existing tag, but skip below logic when a tag has been addded\n anythingAfterNode.trim() && placeCaretAfterNode(addedNode.previousSibling)\n }\n\n // if previous sibling does not exists (meanning the addedNode is the first node in this.DOM.input)\n // or, if the previous sibling is also a tag, add a zero-space character before (to allow showing the caret in Chrome)\n else if( !addedNode.previousSibling || getSetTagData(addedNode.previousSibling) ){\n addedNode.before(ZERO_WIDTH_CHAR)\n }\n }\n })\n\n record.removedNodes.forEach(removedNode => {\n // when trying to delete a tag which is in a new line and there's nothing else there (caret is after the tag)\n if( removedNode && removedNode.nodeName == 'BR' && isNodeTag.call(this, lastInputChild)){\n this.removeTags(lastInputChild)\n this.fixFirefoxLastTagNoCaret()\n }\n })\n })\n\n // get the last child only after the above DOM modifications\n // check these scenarios:\n // 1. after a single line, press ENTER once - should add only 1 BR\n // 2. presss ENTER right before a tag\n // 3. press enter within a text node before a tag\n var lastInputChild = this.DOM.input.lastChild;\n\n if( lastInputChild && lastInputChild.nodeValue == '' )\n lastInputChild.remove()\n\n // make sure the last element is always a BR\n if( !lastInputChild || lastInputChild.nodeName != 'BR' ){\n this.DOM.input.appendChild(document.createElement('br'))\n }\n },\n }\n}\n\n", "import { sameStr, removeCollectionProp, omit, isObject, parseHTML, removeTextChildNodes, escapeHTML, extend, concatWithoutDups, getUID, isNodeTag, injectAtCaret, placeCaretAfterNode, getSetTagData, fixCaretBetweenTags, logger } from './parts/helpers'\nimport DEFAULTS from './parts/defaults'\nimport _dropdown, { initDropdown } from './parts/dropdown'\nimport { getPersistedData, setPersistedData, clearPersistedData } from './parts/persist'\nimport TEXTS from './parts/texts'\nimport templates from './parts/templates'\nimport EventDispatcher from './parts/EventDispatcher'\nimport events, { triggerChangeEvent } from './parts/events'\n\n/**\n * @constructor\n * @param {Object} input DOM element\n * @param {Object} settings settings object\n */\nfunction Tagify( input, settings ){\n if( !input ){\n logger.warn('input element not found', input)\n // return an empty mock of all methods, so the code using tagify will not break\n // because it might be calling methods even though the input element does not exist\n const mockInstance = new Proxy(this, { get(){ return () => mockInstance } })\n return mockInstance\n }\n\n if( input.__tagify ){\n logger.warn('input element is already Tagified - Same instance is returned.', input)\n return input.__tagify\n }\n\n extend(this, EventDispatcher(this))\n this.isFirefox = (/firefox|fxios/i).test(navigator.userAgent) && !(/seamonkey/i).test(navigator.userAgent)\n this.isIE = window.document.documentMode; // https://developer.mozilla.org/en-US/docs/Web/API/Document/compatMode#Browser_compatibility\n\n settings = settings || {};\n this.getPersistedData = getPersistedData(settings.id)\n this.setPersistedData = setPersistedData(settings.id)\n this.clearPersistedData = clearPersistedData(settings.id)\n this.applySettings(input, settings)\n\n this.state = {\n inputText: '',\n editing : false,\n composing: false,\n actions : {}, // UI actions for state-locking\n mixMode : {},\n dropdown: {},\n flaggedTags: {} // in mix-mode, when a string is detetced as potential tag, and the user has chocen to close the suggestions dropdown, keep the record of the tasg here\n }\n\n this.value = [] // tags' data\n\n // events' callbacks references will be stores here, so events could be unbinded\n this.listeners = {}\n\n this.DOM = {} // Store all relevant DOM elements in an Object\n\n this.build(input)\n initDropdown.call(this)\n\n this.getCSSVars()\n this.loadOriginalValues()\n\n this.events.customBinding.call(this)\n this.events.binding.call(this)\n input.autofocus && this.DOM.input.focus()\n input.__tagify = this\n}\n\nTagify.prototype = {\n _dropdown,\n placeCaretAfterNode,\n getSetTagData,\n helpers: {sameStr, removeCollectionProp, omit, isObject, parseHTML, escapeHTML, extend, concatWithoutDups, getUID, isNodeTag},\n\n customEventsList : ['change', 'add', 'remove', 'invalid', 'input', 'paste', 'click', 'keydown', 'focus', 'blur', 'edit:input', 'edit:beforeUpdate', 'edit:updated', 'edit:start', 'edit:keydown', 'dropdown:show', 'dropdown:hide', 'dropdown:select', 'dropdown:updated', 'dropdown:noMatch', 'dropdown:scroll'],\n dataProps: ['__isValid', '__removed', '__originalData', '__originalHTML', '__tagId'], // internal-uasge props\n\n trim(text){\n return this.settings.trim && text && typeof text == \"string\" ? text.trim() : text\n },\n\n // expose this handy utility function\n parseHTML,\n\n templates,\n\n parseTemplate(template, data){\n template = this.settings.templates[template] || template;\n return parseHTML( template.apply(this, data) )\n },\n\n set whitelist( arr ){\n const isArray = arr && Array.isArray(arr)\n this.settings.whitelist = isArray ? arr : []\n this.setPersistedData(isArray ? arr : [], 'whitelist')\n },\n\n get whitelist(){\n return this.settings.whitelist\n },\n\n set userInput( state ){\n this.settings.userInput = !!state\n this.setContentEditable(!!state)\n },\n\n get userInput(){\n return this.settings.userInput\n },\n\n generateClassSelectors(classNames){\n for( let name in classNames ) {\n let currentName = name;\n Object.defineProperty(classNames, currentName + \"Selector\" , {\n get(){ return \".\" + this[currentName].split(\" \")[0] }\n })\n }\n },\n\n applySettings( input, settings ){\n DEFAULTS.templates = this.templates\n\n var mixModeDefaults = {\n dropdown: {\n position: \"text\"\n }\n }\n\n var mergedDefaults = extend({}, DEFAULTS, (settings.mode == 'mix' ? mixModeDefaults : {}));\n var _s = this.settings = extend({}, mergedDefaults, settings)\n\n _s.disabled = input.hasAttribute('disabled')\n _s.readonly = _s.readonly || input.hasAttribute('readonly')\n _s.placeholder = escapeHTML(input.getAttribute('placeholder') || _s.placeholder || \"\")\n _s.required = input.hasAttribute('required')\n\n this.generateClassSelectors(_s.classNames)\n\n if( this.isIE )\n _s.autoComplete = false; // IE goes crazy if this isn't false\n\n [\"whitelist\", \"blacklist\"].forEach(name => {\n var attrVal = input.getAttribute('data-' + name)\n if( attrVal ){\n attrVal = attrVal.split(_s.delimiters)\n if( attrVal instanceof Array )\n _s[name] = attrVal\n }\n })\n\n // backward-compatibility for old version of \"autoComplete\" setting:\n if( \"autoComplete\" in settings && !isObject(settings.autoComplete) ){\n _s.autoComplete = DEFAULTS.autoComplete\n _s.autoComplete.enabled = settings.autoComplete\n }\n\n if( _s.mode == 'mix' ){\n _s.pattern = _s.pattern || /@/;\n _s.autoComplete.rightKey = true\n _s.delimiters = settings.delimiters || null // default dlimiters in mix-mode must be NULL\n\n // needed for \"filterListItems\". This assumes the user might have forgotten to manually\n // define the same term in \"dropdown.searchKeys\" as defined in \"tagTextProp\" setting, so\n // by automatically adding it, tagify is \"helping\" out, guessing the intesntions of the developer.\n if( _s.tagTextProp && !_s.dropdown.searchKeys.includes(_s.tagTextProp) )\n _s.dropdown.searchKeys.push(_s.tagTextProp)\n }\n\n if( input.pattern )\n try { _s.pattern = new RegExp(input.pattern) }\n catch(e){}\n\n // Convert the \"delimiters\" setting into a REGEX object\n if( _s.delimiters ){\n _s._delimiters = _s.delimiters;\n try { _s.delimiters = new RegExp(this.settings.delimiters, \"g\") }\n catch(e){}\n }\n\n if( _s.disabled )\n _s.userInput = false;\n\n this.TEXTS = {...TEXTS, ...(_s.texts || {})}\n\n // it makes sense to enable \"includeSelectedTags\" in \"select-mode\"\n if( _s.mode == 'select' ){\n _s.dropdown.includeSelectedTags = true\n }\n\n // make sure the dropdown will be shown on \"focus\" and not only after typing something (in \"select\" mode)\n if( (_s.mode == 'select' && !settings.dropdown?.enabled) || !_s.userInput ){\n _s.dropdown.enabled = 0\n }\n\n _s.dropdown.appendTarget = settings.dropdown?.appendTarget || document.body;\n\n if ( _s.dropdown.includeSelectedTags === undefined )\n _s.dropdown.includeSelectedTags = _s.duplicates;\n\n // get & merge persisted data with current data\n let persistedWhitelist = this.getPersistedData('whitelist');\n\n if( Array.isArray(persistedWhitelist))\n this.whitelist = Array.isArray(_s.whitelist)\n ? concatWithoutDups(_s.whitelist, persistedWhitelist)\n : persistedWhitelist;\n },\n\n /**\n * Returns a string of HTML element attributes\n * @param {Object} data [Tag data]\n */\n getAttributes( data ){\n var attrs = this.getCustomAttributes(data), s = '', k;\n\n for( k in attrs )\n s += \" \" + k + (data[k] !== undefined ? `=\"${attrs[k]}\"` : \"\");\n\n return s;\n },\n\n /**\n * Returns an object of attributes to be used for the templates\n */\n getCustomAttributes( data ){\n // only items which are objects have properties which can be used as attributes\n if( !isObject(data) )\n return '';\n\n var output = {}, propName;\n\n for( propName in data ){\n if( propName.slice(0,2) != '__' && propName != 'class' && data.hasOwnProperty(propName) && data[propName] !== undefined )\n output[propName] = escapeHTML(data[propName])\n }\n return output\n },\n\n setStateSelection(){\n var selection = window.getSelection()\n\n // save last selection place to be able to inject anything from outside to that specific place\n var sel = {\n anchorOffset: selection.anchorOffset,\n anchorNode : selection.anchorNode,\n range : selection.getRangeAt && selection.rangeCount && selection.getRangeAt(0)\n }\n\n this.state.selection = sel\n return sel\n },\n\n /**\n * Get specific CSS variables which are relevant to this script and parse them as needed.\n * The result is saved on the instance in \"this.CSSVars\"\n */\n getCSSVars(){\n var compStyle = getComputedStyle(this.DOM.scope, null)\n\n const getProp = name => compStyle.getPropertyValue('--'+name)\n\n function seprateUnitFromValue(a){\n if( !a ) return {}\n a = a.trim().split(' ')[0]\n var unit = a.split(/\\d+/g).filter(n=>n).pop().trim(),\n value = +a.split(unit).filter(n=>n)[0].trim()\n return {value, unit}\n }\n\n this.CSSVars = {\n tagHideTransition: (({value, unit}) => unit=='s' ? value * 1000 : value)(seprateUnitFromValue(getProp('tag-hide-transition')))\n }\n },\n\n /**\n * builds the HTML of this component\n * @param {Object} input [DOM element which would be \"transformed\" into \"Tags\"]\n */\n build( input ){\n var DOM = this.DOM,\n labelWrapper = input.closest('label');\n\n if( this.settings.mixMode.integrated ){\n DOM.originalInput = null;\n DOM.scope = input;\n DOM.input = input;\n }\n\n else {\n DOM.originalInput = input\n DOM.originalInput_tabIndex = input.tabIndex\n DOM.scope = this.parseTemplate('wrapper', [input, this.settings])\n DOM.input = DOM.scope.querySelector(this.settings.classNames.inputSelector)\n input.parentNode.insertBefore(DOM.scope, input)\n input.tabIndex = -1; // do not allow focus or typing directly, once tagified\n }\n\n // fixes tagify nested inside a <label> tag from getting focus when clicked on\n if( labelWrapper )\n labelWrapper.setAttribute('for', '')\n },\n\n /**\n * revert any changes made by this component\n */\n destroy(){\n this.events.unbindGlobal.call(this)\n this.DOM.scope.parentNode?.removeChild(this.DOM.scope)\n this.DOM.originalInput.tabIndex = this.DOM.originalInput_tabIndex\n delete this.DOM.originalInput.__tagify\n this.dropdown.hide(true)\n this.removeAllCustomListeners()\n clearTimeout(this.dropdownHide__bindEventsTimeout)\n clearInterval(this.listeners.main.originalInputValueObserverInterval)\n },\n\n /**\n * if the original input has any values, add them as tags\n */\n loadOriginalValues( value ){\n var lastChild,\n _s = this.settings\n\n // temporarily block firing the \"change\" event on the original input until\n // this method finish removing current value and adding a new one\n this.state.blockChangeEvent = true\n\n if( value === undefined ){\n const persistedOriginalValue = this.getPersistedData('value')\n\n // if the field already has a field, trust its the desired\n // one to be rendered and do not use the persisted one\n if( persistedOriginalValue && !this.DOM.originalInput.value )\n value = persistedOriginalValue\n else\n value = _s.mixMode.integrated ? this.DOM.input.textContent : this.DOM.originalInput.value\n }\n\n this.removeAllTags()\n\n if( value ){\n if( _s.mode == 'mix' ){\n this.parseMixTags(value)\n\n lastChild = this.DOM.input.lastChild\n\n // fixes a Chrome bug, when the last node in `mix-mode` is a tag, the caret appears at the far-top-top, outside the field\n if( !lastChild || lastChild.tagName != 'BR' )\n this.DOM.input.insertAdjacentHTML('beforeend', '<br>')\n }\n\n else{\n try{\n if( JSON.parse(value) instanceof Array )\n value = JSON.parse(value)\n }\n catch(err){}\n this.addTags(value, true).forEach(tag => tag && tag.classList.add(_s.classNames.tagNoAnimation))\n }\n }\n\n else\n this.postUpdate()\n\n this.state.lastOriginalValueReported = _s.mixMode.integrated ? '' : this.DOM.originalInput.value\n },\n\n cloneEvent(e){\n var clonedEvent = {}\n for( var v in e )\n if( v != 'path' )\n clonedEvent[v] = e[v]\n return clonedEvent\n },\n\n /**\n * Toogle global loading state on/off\n * Useful when fetching async whitelist while user is typing\n * @param {Boolean} isLoading\n */\n loading( isLoading ){\n this.state.isLoading = isLoading\n // IE11 doesn't support toggle with second parameter\n this.DOM.scope.classList[isLoading ? \"add\" : \"remove\"](this.settings.classNames.scopeLoading)\n return this\n },\n\n /**\n * Toogle a tag loading state on/off\n * @param {Boolean} isLoading\n */\n tagLoading( tagElm, isLoading ){\n if( tagElm )\n // IE11 doesn't support toggle with second parameter\n tagElm.classList[isLoading ? \"add\" : \"remove\"](this.settings.classNames.tagLoading)\n return this\n },\n\n /**\n * Toggles class on the main tagify container (\"scope\")\n * @param {String} className\n * @param {Boolean} force\n */\n toggleClass( className, force ){\n if( typeof className == 'string' )\n this.DOM.scope.classList.toggle(className, force)\n },\n\n toggleScopeValidation( validation ){\n var isValid = validation === true || validation === undefined; // initially it is undefined\n\n if( !this.settings.required && validation && validation === this.TEXTS.empty)\n isValid = true\n\n this.toggleClass(this.settings.classNames.tagInvalid, !isValid)\n this.DOM.scope.title = isValid ? '' : validation\n },\n\n toggleFocusClass( force ){\n this.toggleClass(this.settings.classNames.focus, !!force)\n },\n\n /**\n * Sets the templates placeholder after initialization\n * @param {String} str\n */\n setPlaceholder(str) {\n ['data', 'aria'].forEach(p => this.DOM.input.setAttribute(`${p}-placeholder`, str))\n },\n\n triggerChangeEvent,\n\n events,\n\n fixFirefoxLastTagNoCaret(){\n return // seems to be fixed in newer version of FF, so retiring below code (for now)\n // var inputElm = this.DOM.input\n\n // if( this.isFirefox && inputElm.childNodes.length && inputElm.lastChild.nodeType == 1 ){\n // inputElm.appendChild(document.createTextNode(\"\\u200b\"))\n // this.setRangeAtStartEnd(true, inputElm)\n // return true\n // }\n },\n\n /** https://stackoverflow.com/a/59156872/104380\n * @param {Boolean} start indicating where to place it (start or end of the node)\n * @param {Object} node DOM node to place the caret at\n */\n setRangeAtStartEnd( start, node ){\n if( !node ) return;\n\n start = typeof start == 'number' ? start : !!start\n node = node.lastChild || node;\n var sel = document.getSelection()\n\n // do not force caret placement if the current selection (focus) is on another element (not this tagify instance)\n if( sel.focusNode instanceof Element && !this.DOM.input.contains(sel.focusNode) ) {\n return true\n }\n\n try{\n if( sel.rangeCount >= 1 ){\n ['Start', 'End'].forEach(pos =>\n sel.getRangeAt(0)[\"set\" + pos](node, start ? start : node.length)\n )\n }\n } catch(err){\n console.warn(err)\n }\n },\n\n insertAfterTag( tagElm, newNode ){\n newNode = newNode || this.settings.mixMode.insertAfterTag;\n\n if( !tagElm || !tagElm.parentNode || !newNode ) return\n\n newNode = typeof newNode == 'string'\n ? document.createTextNode(newNode)\n : newNode\n\n tagElm.parentNode.insertBefore(newNode, tagElm.nextSibling)\n return newNode\n },\n\n // compares all \"__originalData\" property values with the current \"tagData\" properties\n // and returns \"true\" if something changed.\n editTagChangeDetected(tagData) {\n var originalData = tagData.__originalData;\n\n for( var prop in originalData )\n if( !this.dataProps.includes(prop) && tagData[prop] != originalData[prop] )\n return true\n\n return false; // not changed\n },\n\n // returns the node which has the actual tag's content\n getTagTextNode(tagElm){\n return tagElm.querySelector(this.settings.classNames.tagTextSelector)\n },\n\n // sets the text of a tag\n setTagTextNode(tagElm, HTML){\n this.getTagTextNode(tagElm).innerHTML = escapeHTML(HTML)\n },\n\n /**\n * Enters a tag into \"edit\" mode\n * @param {Node} tagElm the tag element to edit. if nothing specified, use last last\n */\n editTag( tagElm, opts ){\n tagElm = tagElm || this.getLastTag()\n opts = opts || {}\n\n var _s = this.settings,\n editableElm = this.getTagTextNode(tagElm),\n tagIdx = this.getNodeIndex(tagElm),\n tagData = getSetTagData(tagElm),\n _CB = this.events.callbacks,\n isValid = true,\n isSelectMode = _s.mode == 'select'\n\n // select mode is a bit different as clicking the tagify's content once will get into edit-mode if a value\n // is already selected, and there cannot be a dropdown already open at this point.\n !isSelectMode && this.dropdown.hide()\n\n if( !editableElm ){\n logger.warn('Cannot find element in Tag template: .', _s.classNames.tagTextSelector);\n return;\n }\n\n if( tagData instanceof Object && \"editable\" in tagData && !tagData.editable )\n return\n\n // cache the original data, on the DOM node, before any modification ocurs, for possible revert\n tagData = getSetTagData(tagElm, {\n __originalData: extend({}, tagData),\n __originalHTML: tagElm.cloneNode(true)\n })\n // re-set the tagify custom-prop on the clones element (because cloning removed it)\n getSetTagData(tagData.__originalHTML, tagData.__originalData)\n\n editableElm.setAttribute('contenteditable', true)\n tagElm.classList.add( _s.classNames.tagEditing )\n\n // because \"editTag\" method can be called manually, make sure that \"state.editing\" is set correctly\n this.events.callbacks.onEditTagFocus.call(this, tagElm)\n\n editableElm.addEventListener('click' , _CB.onEditTagClick.bind(this, tagElm))\n editableElm.addEventListener('blur' , _CB.onEditTagBlur.bind(this, this.getTagTextNode(tagElm)))\n editableElm.addEventListener('input' , _CB.onEditTagInput.bind(this, editableElm))\n editableElm.addEventListener('paste' , _CB.onEditTagPaste.bind(this, editableElm))\n editableElm.addEventListener('keydown' , e => _CB.onEditTagkeydown.call(this, e, tagElm))\n editableElm.addEventListener('compositionstart' , _CB.onCompositionStart.bind(this))\n editableElm.addEventListener('compositionend' , _CB.onCompositionEnd.bind(this))\n\n if( !opts.skipValidation )\n isValid = this.editTagToggleValidity(tagElm)\n\n editableElm.originalIsValid = isValid\n\n this.trigger(\"edit:start\", { tag:tagElm, index:tagIdx, data:tagData, isValid })\n\n editableElm.focus()\n !isSelectMode && this.setRangeAtStartEnd(false, editableElm) // place the caret at the END of the editable tag text\n\n _s.dropdown.enabled === 0 && !isSelectMode && this.dropdown.show()\n this.state.hasFocus = true\n\n return this\n },\n\n /**\n * If a tag is invalid, for any reason, set its class to \"not allowed\" (see defaults file)\n * @param {Node} tagElm required\n * @param {Object} tagData optional\n * @returns true if valid, a string (reason) if not\n */\n editTagToggleValidity( tagElm, tagData ){\n var tagData = tagData || getSetTagData(tagElm),\n isValid;\n\n if( !tagData ){\n logger.warn(\"tag has no data: \", tagElm, tagData)\n return;\n }\n\n isValid = !(\"__isValid\" in tagData) || tagData.__isValid === true\n\n if( !isValid ){\n this.removeTagsFromValue(tagElm)\n }\n\n this.update()\n\n //this.validateTag(tagData);\n\n tagElm.classList.toggle(this.settings.classNames.tagNotAllowed, !isValid)\n tagData.__isValid = isValid;\n\n return tagData.__isValid\n },\n\n onEditTagDone(tagElm, tagData){\n tagElm = tagElm || this.state.editing.scope\n tagData = tagData || {}\n\n var _s = this.settings,\n eventData = {\n tag : tagElm,\n index : this.getNodeIndex(tagElm),\n previousData: getSetTagData(tagElm),\n data : tagData\n }\n\n this.trigger(\"edit:beforeUpdate\", eventData, {cloneData:false})\n\n this.state.editing = false;\n\n delete tagData.__originalData\n delete tagData.__originalHTML\n\n // some scenarrios like in the one in the demos page with textarea that has 2 whitelists, one of the whitelist might be\n // an array of objects with a property defined the same as the `tagTextProp` setting (if used) but another whitelist\n // might be simpler - just an array of primitives.\n function veryfyTagTextProp() {\n var tagTextProp = tagData[_s.tagTextProp];\n\n // 'tagTextProp' might also be the number 0 so checking for `undefined` here:\n if( tagTextProp !== undefined ) {\n tagTextProp += ''; // cast possible number into a string\n return !!tagTextProp.trim?.()\n }\n\n if( !(_s.tagTextProp in tagData) )\n return !!tagData.value\n }\n\n if( tagElm && tagElm.parentNode ){\n if( veryfyTagTextProp() ){\n tagElm = this.replaceTag(tagElm, tagData)\n this.editTagToggleValidity(tagElm, tagData)\n\n if( _s.a11y.focusableTags )\n tagElm.focus()\n else if( _s.mode != 'select' )\n // place caret after edited tag\n placeCaretAfterNode(tagElm)\n }\n\n else\n this.removeTags(tagElm)\n }\n\n this.trigger(\"edit:updated\", eventData)\n _s.dropdown.closeOnSelect && this.dropdown.hide()\n\n // check if any of the current tags which might have been marked as \"duplicate\" should be now un-marked\n if( this.settings.keepInvalidTags )\n this.reCheckInvalidTags()\n },\n\n /**\n * Replaces an exisitng tag with a new one. Used for updating a tag's data\n * @param {Object} tagElm [DOM node to replace]\n * @param {Object} tagData [data to create new tag from]\n */\n replaceTag(tagElm, tagData){\n if( !tagData || tagData.value === '' || tagData.value === undefined )\n tagData = tagElm.__tagifyTagData\n\n // if tag is invalid, make the according changes in the newly created element\n if( tagData.__isValid && tagData.__isValid != true )\n extend( tagData, this.getInvalidTagAttrs(tagData, tagData.__isValid) )\n\n var newTagElm = this.createTagElem(tagData)\n\n // update DOM\n tagElm.parentNode.replaceChild(newTagElm, tagElm)\n this.updateValueByDOMTags()\n return newTagElm\n },\n\n /**\n * update \"value\" (Array of Objects) by traversing all valid tags\n */\n updateValueByDOMTags(){\n this.value.length = 0;\n\n var clsNames = this.settings.classNames,\n tagNotAllowedClassName = clsNames.tagNotAllowed.split(' ')[0],\n skipNodesWithClassNames = [tagNotAllowedClassName, clsNames.tagHide];\n\n [].forEach.call(this.getTagElms(), node => {\n if ([...node.classList].some(cls => skipNodesWithClassNames.includes(cls))) return;\n this.value.push( getSetTagData(node) )\n })\n\n this.update()\n this.dropdown.refilter()\n },\n\n /**\n * injects nodes/text at caret position, which is saved on the \"state\" when \"blur\" event gets triggered\n * @param {Node} injectedNode [the node to inject at the caret position]\n * @param {Object} selection [optional range Object. must have \"anchorNode\" & \"anchorOffset\"]\n */\n injectAtCaret( injectedNode, range ){\n range = range || this.state.selection?.range\n\n if(typeof injectedNode === 'string')\n injectedNode = document.createTextNode(injectedNode)\n\n if( !range && injectedNode ) {\n this.appendMixTags(injectedNode)\n return this;\n }\n\n let node = injectAtCaret(injectedNode, range)\n this.setRangeAtStartEnd(false, node)\n\n this.updateValueByDOMTags() // updates internal \"this.value\"\n this.update() // updates original input/textarea\n\n return this\n },\n\n /**\n * input bridge for accessing & setting\n * @type {Object}\n */\n input : {\n set( value = '', updateDOM = true ){\n var _s = this.settings,\n hideDropdown = _s.dropdown.closeOnSelect\n\n this.state.inputText = value\n\n if( updateDOM ) {\n this.DOM.input.innerHTML = escapeHTML(\"\"+value);\n value && this.toggleClass(_s.classNames.empty, !this.DOM.input.innerHTML) // remove the \"empty\" (is exists) class only if a value was added\n }\n\n if( !value && hideDropdown )\n this.dropdown.hide.bind(this)\n\n this.input.autocomplete.suggest.call(this);\n this.input.validate.call(this);\n\n },\n\n raw(){\n return this.DOM.input.textContent\n },\n\n /**\n * Marks the tagify's input as \"invalid\" if the value did not pass \"validateTag()\"\n */\n validate(){\n var isValid = !this.state.inputText || this.validateTag({value:this.state.inputText}) === true;\n\n this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid, !isValid)\n\n return isValid\n },\n\n // remove any child DOM elements that aren't of type TEXT (like <br>)\n normalize( node, options ){\n var clone = node || this.DOM.input, //.cloneNode(true),\n v = [];\n\n // when a text was pasted in FF, the \"this.DOM.input\" element will have <br> but no newline symbols (\\n), and this will\n // result in tags not being properly created if one wishes to create a separate tag per newline.\n clone.childNodes.forEach(n => n.nodeType==3 && v.push(n.nodeValue))\n v = v.join(\"\\n\")\n\n try{\n // \"delimiters\" might be of a non-regex value, where this will fail (\"Tags With Properties\" example in demo page):\n v = v.replace(/(?:\\r\\n|\\r|\\n)/g, this.settings.delimiters.source.charAt(0))\n }\n catch(err){}\n\n v = v.replace(/\\s/g, ' ') // replace NBSPs with spaces characters\n\n return options?.trim ? this.trim(v) : v\n },\n\n /**\n * suggest the rest of the input's value (via CSS \"::after\" using \"content:attr(...)\")\n * @param {String} s [description]\n */\n autocomplete : {\n suggest( data ){\n if( !this.settings.autoComplete.enabled ) return;\n\n data = data || {value:''}\n if (typeof data !== 'object') data = { value: data };\n\n var suggestedText = this.dropdown.getMappedValue(data);\n\n if( typeof suggestedText === 'number' ) return\n\n var inputText = this.state.inputText.toLowerCase(),\n suggestionStart = suggestedText.substr(0, this.state.inputText.length).toLowerCase(),\n suggestionTrimmed = suggestedText.substring(this.state.inputText.length);\n\n if( !suggestedText || !this.state.inputText || suggestionStart != inputText ){\n this.DOM.input.removeAttribute(\"data-suggest\");\n delete this.state.inputSuggestion\n }\n else{\n this.DOM.input.setAttribute(\"data-suggest\", suggestionTrimmed);\n this.state.inputSuggestion = data\n }\n },\n\n /**\n * sets the suggested text as the input's value & cleanup the suggestion autocomplete.\n * @param {String} s [text]\n */\n set( s ){\n var dataSuggest = this.DOM.input.getAttribute('data-suggest'),\n suggestion = s || (dataSuggest ? this.state.inputText + dataSuggest : null);\n\n if( suggestion ){\n if( this.settings.mode == 'mix' ){\n this.replaceTextWithNode( document.createTextNode(this.state.tag.prefix + suggestion) )\n }\n else{\n this.input.set.call(this, suggestion);\n this.setRangeAtStartEnd(false, this.DOM.input)\n }\n\n this.input.autocomplete.suggest.call(this);\n this.dropdown.hide();\n\n return true;\n }\n\n return false;\n }\n }\n },\n\n /**\n * returns the index of the the tagData within the \"this.value\" array collection.\n * since values should be unique, it is suffice to only search by \"value\" property\n * @param {Object} tagData\n */\n getTagIdx( tagData ){\n return this.value.findIndex(item => item.__tagId == (tagData||{}).__tagId )\n },\n\n getNodeIndex( node ){\n var index = 0;\n\n if( node )\n while( (node = node.previousElementSibling) )\n index++;\n\n return index;\n },\n\n getTagElms( ...classess ){\n var classname = '.' + [...this.settings.classNames.tag.split(' '), ...classess].join('.')\n return [].slice.call(this.DOM.scope.querySelectorAll(classname)) // convert nodeList to Array - https://stackoverflow.com/a/3199627/104380\n },\n\n /**\n * gets the last non-readonly, not-in-the-proccess-of-removal tag\n */\n getLastTag(){\n var _sc = this.settings.classNames,\n tagNodes = this.DOM.scope.querySelectorAll(`${_sc.tagSelector}:not(.${_sc.tagHide}):not([readonly])`);\n return tagNodes[tagNodes.length - 1];\n },\n\n /**\n * Searches if any tag with a certain value already exis\n * @param {String/Object} value [text value / tag data object]\n * @param {Boolean} caseSensitive\n * @return {Number}\n */\n isTagDuplicate( value, caseSensitive, tagId ){\n var dupsCount = 0;\n\n for( let item of this.value ) {\n let isSameStr = sameStr( this.trim(\"\"+value), item.value, caseSensitive );\n if( isSameStr && tagId != item.__tagId )\n dupsCount++;\n }\n\n return dupsCount\n },\n\n getTagIndexByValue( value ){\n var indices = [],\n isCaseSensitive = this.settings.dropdown.caseSensitive;\n\n this.getTagElms().forEach((tagElm, i) => {\n if( tagElm.__tagifyTagData && sameStr( this.trim(tagElm.__tagifyTagData.value), value, isCaseSensitive ) )\n indices.push(i)\n })\n\n return indices;\n },\n\n getTagElmByValue( value ){\n var tagIdx = this.getTagIndexByValue(value)[0]\n return this.getTagElms()[tagIdx]\n },\n\n /**\n * Temporarily marks a tag element (by value or Node argument)\n * @param {Object} tagElm [a specific \"tag\" element to compare to the other tag elements siblings]\n */\n flashTag( tagElm ){\n if( tagElm ){\n tagElm.classList.add(this.settings.classNames.tagFlash)\n setTimeout(() => { tagElm.classList.remove(this.settings.classNames.tagFlash) }, 100)\n }\n },\n\n /**\n * checks if text is in the blacklist\n */\n isTagBlacklisted( v ){\n v = this.trim(v.toLowerCase());\n return this.settings.blacklist.filter(x => (\"\"+x).toLowerCase() == v).length;\n },\n\n /**\n * checks if text is in the whitelist\n */\n isTagWhitelisted( v ){\n return !!this.getWhitelistItem(v)\n /*\n return this.settings.whitelist.some(item =>\n typeof v == 'string'\n ? sameStr(this.trim(v), (item.value || item))\n : sameStr(JSON.stringify(item), JSON.stringify(v))\n )\n */\n },\n\n /**\n * Returns the first whitelist item matched, by value (if match found)\n * @param {String} value [text to match by]\n */\n getWhitelistItem( value, prop, whitelist ){\n var result,\n prop = prop || 'value',\n _s = this.settings,\n whitelist = whitelist || _s.whitelist;\n\n whitelist.some(_wi => {\n // whitelist item value. Can be either a String, Number or an Object (with a `value` property)\n var _wiv = typeof _wi == 'object' ? (_wi[prop] || _wi.value) : _wi,\n isSameStr = sameStr(_wiv, value, _s.dropdown.caseSensitive, _s.trim)\n\n if( isSameStr ){\n result = typeof _wi == 'object' ? _wi : {value:_wi}\n return true\n }\n })\n\n // first iterate the whitelist, try find matches by \"value\" and if that fails\n // and a \"tagTextProp\" is set to be other than \"value\", try that also\n if( !result && prop == 'value' && _s.tagTextProp != 'value' ){\n // if found, adds the first which matches\n result = this.getWhitelistItem(value, _s.tagTextProp, whitelist)\n }\n\n return result\n },\n\n /**\n * validate a tag object BEFORE the actual tag will be created & appeneded\n * @param {String} s\n * @param {String} uid [unique ID, to not inclue own tag when cheking for duplicates]\n * @return {Boolean/String} [\"true\" if validation has passed, String for a fail]\n */\n validateTag( tagData ){\n var _s = this.settings,\n // when validating a tag in edit-mode, need to take \"tagTextProp\" into consideration\n prop = \"value\" in tagData ? \"value\" : _s.tagTextProp,\n v = this.trim(tagData[prop] + \"\");\n\n // check for definitive empty value\n if( !(tagData[prop]+\"\").trim() )\n return this.TEXTS.empty;\n\n // check if pattern should be used and if so, use it to test the value\n if( _s.mode != 'mix' && _s.pattern && _s.pattern instanceof RegExp && !(_s.pattern.test(v)) )\n return this.TEXTS.pattern;\n\n // check for duplicates\n if( !_s.duplicates && this.isTagDuplicate(v, _s.dropdown.caseSensitive, tagData.__tagId) )\n return this.TEXTS.duplicate;\n\n if( this.isTagBlacklisted(v) || (_s.enforceWhitelist && !this.isTagWhitelisted(v)) )\n return this.TEXTS.notAllowed;\n\n if( _s.validate )\n return _s.validate(tagData)\n\n return true\n },\n\n getInvalidTagAttrs(tagData, validation){\n return {\n \"aria-invalid\" : true,\n \"class\": `${tagData.class || ''} ${this.settings.classNames.tagNotAllowed}`.trim(),\n \"title\": validation\n }\n },\n\n hasMaxTags(){\n return this.value.length >= this.settings.maxTags\n ? this.TEXTS.exceed\n : false\n },\n\n setReadonly( toggle, attrribute ){\n var _s = this.settings\n\n this.DOM.scope.contains(document.activeElement) && document.activeElement.blur() // exit possible edit-mode\n _s[attrribute || 'readonly'] = toggle\n this.DOM.scope[(toggle ? 'set' : 'remove') + 'Attribute'](attrribute || 'readonly', true)\n\n this.settings.userInput = true;\n this.setContentEditable(!toggle)\n },\n\n setContentEditable(state){\n this.DOM.input.contentEditable = state\n this.DOM.input.tabIndex = !!state ? 0 : -1;\n },\n\n setDisabled( isDisabled ){\n this.setReadonly(isDisabled, 'disabled')\n },\n\n /**\n * pre-proccess the tagsItems, which can be a complex tagsItems like an Array of Objects or a string comprised of multiple words\n * so each item should be iterated on and a tag created for.\n * @return {Array} [Array of Objects]\n */\n normalizeTags( tagsItems ){\n var {whitelist, delimiters, mode, tagTextProp} = this.settings,\n whitelistMatches = [],\n whitelistWithProps = whitelist ? whitelist[0] instanceof Object : false,\n // checks if this is a \"collection\", meanning an Array of Objects\n isArray = Array.isArray(tagsItems),\n isCollection = isArray && tagsItems[0].value,\n mapStringToCollection = s => (s+\"\").split(delimiters).reduce((acc, v) => {\n const trimmed = this.trim(v)\n trimmed && acc.push({ [tagTextProp]:trimmed, value:trimmed })\n return acc\n }, [])\n\n if( typeof tagsItems == 'number' )\n tagsItems = tagsItems.toString()\n\n // if the argument is a \"simple\" String, ex: \"aaa, bbb, ccc\"\n if( typeof tagsItems == 'string' ){\n if( !tagsItems.trim() ) return [];\n\n // go over each tag and add it (if there were multiple ones)\n tagsItems = mapStringToCollection(tagsItems)\n }\n\n // if is an Array of Strings, convert to an Array of Objects\n else if( isArray ){\n // flatten the 2D array\n tagsItems = tagsItems.reduce((acc, item) => {\n if( isObject(item) ) {\n var itemCopy = extend({}, item)\n\n // if 'tagTextProp' property does not exist in the item, use `value` instead\n if(!(tagTextProp in itemCopy))\n tagTextProp = 'value'\n\n itemCopy[tagTextProp] = this.trim(itemCopy[tagTextProp])\n\n // discard empty tags but allow `0` as a valid value\n if( itemCopy[tagTextProp] || itemCopy[tagTextProp] === 0 )\n acc.push(itemCopy) // mapStringToCollection(item.value).map(newItem => ({...item,...newItem}))\n }\n\n else if(item != null && item !== '' && item !== undefined) {\n acc.push( ...mapStringToCollection(item) )\n }\n\n return acc\n }, [])\n }\n\n // search if the tag exists in the whitelist as an Object (has props),\n // to be able to use its properties.\n // skip matching collections with whitelist items as they are considered \"whole\"\n if( whitelistWithProps && !isCollection ){\n tagsItems.forEach(item => {\n var whitelistMatchesValues = whitelistMatches.map(a=>a.value)\n\n // if suggestions are shown, they are already filtered, so it's easier to use them,\n // because the whitelist might also include items which have already been added\n var filteredList = this.dropdown.filterListItems.call(this, item[tagTextProp], { exact:true })\n\n if( !this.settings.duplicates )\n // also filter out items which have already been matched in previous iterations\n filteredList = filteredList.filter(filteredItem => !whitelistMatchesValues.includes(filteredItem.value))\n\n // get the best match out of list of possible matches.\n // if there was a single item in the filtered list, use that one\n var matchObj = filteredList.length > 1\n ? this.getWhitelistItem(item[tagTextProp], tagTextProp, filteredList)\n : filteredList[0]\n\n if( matchObj && matchObj instanceof Object ){\n whitelistMatches.push( matchObj ) // set the Array (with the found Object) as the new value\n }\n else if( mode != 'mix' ){\n if( item.value == undefined )\n item.value = item[tagTextProp]\n whitelistMatches.push(item)\n }\n })\n\n if( whitelistMatches.length )\n tagsItems = whitelistMatches\n }\n\n return tagsItems;\n },\n\n /**\n * Parse the initial value of a textarea (or input) element and generate mixed text w/ tags\n * https://stackoverflow.com/a/57598892/104380\n * @param {String} s\n */\n parseMixTags( s ){\n var {mixTagsInterpolator, duplicates, transformTag, enforceWhitelist, maxTags, tagTextProp} = this.settings,\n tagsDataSet = [];\n\n s = s.split(mixTagsInterpolator[0]).map((s1, i) => {\n var s2 = s1.split(mixTagsInterpolator[1]),\n preInterpolated = s2[0],\n maxTagsReached = tagsDataSet.length == maxTags,\n textProp,\n tagData,\n tagElm;\n\n try{\n // skip numbers and go straight to the \"catch\" statement\n if( preInterpolated == +preInterpolated )\n throw Error\n tagData = JSON.parse(preInterpolated)\n } catch(err){\n tagData = this.normalizeTags(preInterpolated)[0] || {value:preInterpolated}\n }\n\n transformTag.call(this, tagData)\n\n if( !maxTagsReached &&\n s2.length > 1 &&\n (!enforceWhitelist || this.isTagWhitelisted(tagData.value)) &&\n !(!duplicates && this.isTagDuplicate(tagData.value)) ){\n\n // in case \"tagTextProp\" setting is set to other than \"value\" and this tag does not have this prop\n textProp = tagData[tagTextProp] ? tagTextProp : 'value'\n tagData[textProp] = this.trim(tagData[textProp])\n\n tagElm = this.createTagElem(tagData)\n tagsDataSet.push( tagData )\n tagElm.classList.add(this.settings.classNames.tagNoAnimation)\n\n s2[0] = tagElm.outerHTML //+ \"⁠\" // put a zero-space at the end so the caret won't jump back to the start (when the last input's child element is a tag)\n this.value.push(tagData)\n }\n else if(s1)\n return i ? mixTagsInterpolator[0] + s1 : s1\n\n return s2.join('')\n }).join('')\n\n this.DOM.input.innerHTML = s\n this.DOM.input.appendChild(document.createTextNode(''))\n this.DOM.input.normalize()\n\n var tagNodes = this.getTagElms()\n\n tagNodes.forEach((elm, idx) => getSetTagData(elm, tagsDataSet[idx]))\n this.update({withoutChangeEvent:true})\n\n fixCaretBetweenTags(tagNodes, this.state.hasFocus)\n return s\n },\n\n /**\n * For mixed-mode: replaces a text starting with a prefix with a wrapper element (tag or something)\n * First there *has* to be a \"this.state.tag\" which is a string that was just typed and is staring with a prefix\n */\n replaceTextWithNode( newWrapperNode, strToReplace ){\n if( !this.state.tag && !strToReplace ) return;\n\n strToReplace = strToReplace || this.state.tag.prefix + this.state.tag.value;\n var idx, nodeToReplace,\n selection = this.state.selection || window.getSelection(),\n nodeAtCaret = selection.anchorNode,\n firstSplitOffset = this.state.tag.delimiters ? this.state.tag.delimiters.length : 0;\n\n // STEP 1: ex. replace #ba with the tag \"bart\" where \"|\" is where the caret is:\n // CURRENT STATE: \"foo #ba #ba| #ba\"\n\n // split the text node at the index of the caret\n nodeAtCaret.splitText(selection.anchorOffset - firstSplitOffset)\n\n // node 0: \"foo #ba #ba|\"\n // node 1: \" #ba\"\n\n // get index of LAST occurence of \"#ba\"\n idx = nodeAtCaret.nodeValue.lastIndexOf(strToReplace)\n\n if( idx == -1 ) return true;\n\n nodeToReplace = nodeAtCaret.splitText(idx)\n\n // node 0: \"foo #ba \"\n // node 1: \"#ba\" <- nodeToReplace\n\n newWrapperNode && nodeAtCaret.parentNode.replaceChild(newWrapperNode, nodeToReplace)\n\n // must NOT normalize contenteditable or it will cause unwanted issues:\n // https://monosnap.com/file/ZDVmRvq5upYkidiFedvrwzSswegWk7\n // nodeAtCaret.parentNode.normalize()\n\n return true;\n },\n\n /**\n * Validate a tag's data and create a new tag node\n * @param {*} tagData\n * @param {*} options\n * @returns Object\n */\n prepareNewTagNode(tagData, options) {\n options = options || {}\n\n var tagElm,\n _s = this.settings,\n aggregatedInvalidInput = [],\n tagElmParams = {},\n originalData = Object.assign({}, tagData, {value:tagData.value+\"\"});\n\n // shallow-clone tagData so later modifications will not apply to the source\n tagData = Object.assign({}, originalData)\n _s.transformTag.call(this, tagData)\n\n tagData.__isValid = this.hasMaxTags() || this.validateTag(tagData)\n\n if( tagData.__isValid !== true ){\n if( options.skipInvalid )\n return\n\n // originalData is kept because it might be that this tag is invalid because it is a duplicate of another,\n // and if that other tags is edited/deleted, this one should be re-validated and if is no more a duplicate - restored\n extend(tagElmParams, this.getInvalidTagAttrs(tagData, tagData.__isValid), {__preInvalidData:originalData})\n\n if( tagData.__isValid == this.TEXTS.duplicate )\n // mark, for a brief moment, the tag (this this one) which THIS CURRENT tag is a duplcate of\n this.flashTag( this.getTagElmByValue(tagData.value) )\n\n if( !_s.createInvalidTags ){\n aggregatedInvalidInput.push(tagData.value)\n return\n }\n }\n\n if( 'readonly' in tagData ){\n if( tagData.readonly )\n tagElmParams[\"aria-readonly\"] = true\n // if \"readonly\" is \"false\", remove it from the tagData so it won't be added as an attribute in the template\n else\n delete tagData.readonly\n }\n\n // Create tag HTML element\n tagElm = this.createTagElem(tagData, tagElmParams)\n\n return {tagElm, tagData, aggregatedInvalidInput}\n },\n\n /**\n * Logic to happen once a tag has just been injected into the DOM\n * @param {Node} tagElm\n * @param {Object} tagData\n */\n postProcessNewTagNode(tagElm, tagData) {\n var _s = this.settings,\n isValid = tagData.__isValid;\n\n if( isValid && isValid === true ){\n // update state\n this.value.push(tagData)\n }\n else{\n this.trigger('invalid', {data:tagData, index:this.value.length, tag:tagElm, message:isValid})\n if( !_s.keepInvalidTags )\n // remove invalid tags (if \"keepInvalidTags\" is set to \"false\")\n setTimeout(() => this.removeTags(tagElm, true), 1000)\n }\n\n this.dropdown.position() // reposition the dropdown because the just-added tag might cause a new-line\n },\n\n /**\n * For selecting a single option (not used for multiple tags, but for \"mode:select\" only)\n * @param {Object} tagElm Tag DOM node\n * @param {Object} tagData Tag data\n */\n selectTag( tagElm, tagData ){\n var _s = this.settings\n\n if( _s.enforceWhitelist && !this.isTagWhitelisted(tagData.value) )\n return\n\n // this.input.set.call(this, tagData[_s.tagTextProp] || tagData.value, true)\n\n // place the caret at the end of the input, only if a dropdown option was selected (and not by manually typing another value and clicking \"TAB\")\n if( this.state.actions.selectOption )\n setTimeout(() => this.setRangeAtStartEnd(false, this.DOM.input))\n\n var lastTagElm = this.getLastTag()\n\n if( lastTagElm )\n this.replaceTag(lastTagElm, tagData)\n else\n this.appendTag(tagElm)\n\n // if( _s.enforceWhitelist )\n // this.setContentEditable(false);\n\n this.value[0] = tagData\n this.update()\n this.trigger('add', { tag:tagElm, data:tagData })\n\n return [tagElm]\n },\n\n /**\n * add an empty \"tag\" element in an editable state\n */\n addEmptyTag( initialData ){\n var tagData = extend({ value:\"\" }, initialData || {}),\n tagElm = this.createTagElem(tagData)\n\n getSetTagData(tagElm, tagData)\n\n // add the tag to the component's DOM\n this.appendTag(tagElm)\n this.editTag(tagElm, {skipValidation:true})\n this.toggleFocusClass(true)\n },\n\n /**\n * add a \"tag\" element to the \"tags\" component\n * @param {String/Array} tagsItems [A string (single or multiple values with a delimiter), or an Array of Objects or just Array of Strings]\n * @param {Boolean} clearInput [flag if the input's value should be cleared after adding tags]\n * @param {Boolean} skipInvalid [do not add, mark & remove invalid tags]\n * @return {Array} Array of DOM elements (tags)\n */\n addTags( tagsItems, clearInput, skipInvalid ){\n var tagElems = [],\n _s = this.settings,\n aggregatedInvalidInput = [],\n frag = document.createDocumentFragment(),\n addedTags = []; // all tags, also invalid. this is used for firing the `add` event\n\n if( !tagsItems || tagsItems.length == 0 ){\n return tagElems\n }\n\n // converts Array/String/Object to an Array of Objects\n tagsItems = this.normalizeTags(tagsItems)\n\n switch( _s.mode ){\n case 'mix': return this.addMixTags(tagsItems)\n case 'select': {\n clearInput = false\n this.removeAllTags()\n }\n }\n\n this.DOM.input.removeAttribute('style')\n\n tagsItems.forEach(tagData => {\n const newTagNode = this.prepareNewTagNode(tagData, {skipInvalid: skipInvalid || _s.skipInvalid});\n\n if( !newTagNode) return;\n\n const tagElm = newTagNode.tagElm;\n\n tagData = newTagNode.tagData\n aggregatedInvalidInput = newTagNode.aggregatedInvalidInput\n\n tagElems.push(tagElm)\n\n // mode-select overrides\n if( _s.mode == 'select' ){\n return this.selectTag(tagElm, tagData)\n }\n\n // add the tag to the component's DOM\n // this.appendTag(tagElm)\n frag.appendChild(tagElm)\n this.postProcessNewTagNode(tagElm, tagData)\n addedTags.push({tagElm, tagData})\n })\n\n this.appendTag(frag)\n\n addedTags.forEach(({tagElm, tagData}) =>\n this.trigger('add', {tag:tagElm, index:this.getTagIdx(tagData), data:tagData})\n )\n\n this.update()\n\n\n if( tagsItems.length && clearInput ){\n this.input.set.call(this, _s.createInvalidTags ? '' : aggregatedInvalidInput.join(_s._delimiters))\n this.setRangeAtStartEnd(false, this.DOM.input)\n }\n\n // hydrate the suggestions list\n this.dropdown.refilter()\n return tagElems\n },\n\n /**\n * Adds a mix-content tag\n * @param {String/Array} tagData A string (single or multiple values with a delimiter), or an Array of Objects or just Array of Strings\n */\n addMixTags( tagsData ){\n tagsData = this.normalizeTags(tagsData);\n\n // flow for creating custom tags which aren't a part of the whitelist\n if( tagsData[0].prefix || this.state.tag ){\n return this.prefixedTextToTag(tagsData[0])\n }\n\n var frag = document.createDocumentFragment()\n\n tagsData.forEach(tagData => {\n const newTagNode = this.prepareNewTagNode(tagData)\n frag.appendChild(newTagNode.tagElm)\n this.insertAfterTag(newTagNode.tagElm)\n this.postProcessNewTagNode(newTagNode.tagElm, newTagNode.tagData)\n })\n\n this.appendMixTags(frag)\n\n return frag.children\n },\n\n appendMixTags( node ) {\n var selection = !!this.state.selection;\n\n // if \"selection\" exists, assumes intention of inecting the new tag at the last\n // saved location of the caret inside \"this.DOM.input\"\n if( selection ){\n this.injectAtCaret(node)\n }\n // else, create a range and inject the new tag as the last child of \"this.DOM.input\"\n else{\n this.DOM.input.focus()\n selection = this.setStateSelection()\n selection.range.setStart(this.DOM.input, selection.range.endOffset)\n selection.range.setEnd(this.DOM.input, selection.range.endOffset)\n this.DOM.input.appendChild(node)\n\n this.updateValueByDOMTags() // updates internal \"this.value\"\n this.update() // updates original input/textarea\n }\n },\n\n /**\n * Adds a tag which was activly typed by the user\n * @param {String/Array} tagData [A string (single or multiple values with a delimiter), or an Array of Objects or just Array of Strings]\n */\n prefixedTextToTag( tagData ){\n var _s = this.settings,\n tagElm,\n newTag,\n createdFromDelimiters = this.state.tag?.delimiters;\n\n tagData.prefix = tagData.prefix || this.state.tag ? this.state.tag.prefix : (_s.pattern.source||_s.pattern)[0];\n\n newTag = this.prepareNewTagNode(tagData)\n tagElm = newTag.tagElm\n\n // tries to replace a taged textNode with a tagElm, and if not able,\n // insert the new tag to the END if \"addTags\" was called from outside\n if( !this.replaceTextWithNode(tagElm) ){\n this.DOM.input.appendChild(tagElm)\n }\n\n setTimeout(()=> tagElm.classList.add(this.settings.classNames.tagNoAnimation), 300)\n\n this.update()\n\n if( !createdFromDelimiters ) {\n var elm = this.insertAfterTag(tagElm) || tagElm;\n // a timeout is needed when selecting a tag from the suggestions via mouse.\n // Without it, it seems the caret is placed right after the tag and not after the\n // node which was inserted after the tag (whitespace by default)\n setTimeout(placeCaretAfterNode, 0, elm);\n }\n\n this.state.tag = null\n\n this.postProcessNewTagNode(tagElm, newTag.tagData)\n\n return tagElm\n },\n\n /**\n * appened (validated) tag to the component's DOM scope\n */\n appendTag(tagElm){\n var DOM = this.DOM,\n insertBeforeNode = DOM.input;\n\n //if( insertBeforeNode === DOM.input )\n DOM.scope.insertBefore(tagElm, insertBeforeNode)\n //else\n // DOM.scope.appendChild(tagElm)\n },\n\n /**\n * creates a DOM tag element and injects it into the component (this.DOM.scope)\n * @param {Object} tagData [text value & properties for the created tag]\n * @param {Object} extraData [properties which are for the HTML template only]\n * @return {Object} [DOM element]\n */\n createTagElem( tagData, extraData ){\n tagData.__tagId = getUID()\n\n var tagElm,\n templateData = extend({}, tagData, { value:escapeHTML(tagData.value+\"\"), ...extraData });\n\n // if( this.settings.readonly )\n // tagData.readonly = true\n\n tagElm = this.parseTemplate('tag', [templateData, this])\n\n // crucial for proper caret placement when deleting content. if textNodes are allowed as children of a tag element,\n // a browser bug casues the caret to be misplaced inside the tag element (especially affects \"readonly\" tags)\n removeTextChildNodes(tagElm)\n // while( tagElm.lastChild.nodeType == 3 )\n // tagElm.lastChild.parentNode.removeChild(tagElm.lastChild)\n\n getSetTagData(tagElm, tagData)\n return tagElm\n },\n\n /**\n * re-check all invalid tags.\n * called after a tag was edited or removed\n */\n reCheckInvalidTags(){\n var _s = this.settings\n\n this.getTagElms(_s.classNames.tagNotAllowed).forEach((tagElm, i) => {\n var tagData = getSetTagData(tagElm),\n hasMaxTags = this.hasMaxTags(),\n tagValidation = this.validateTag(tagData),\n isValid = tagValidation === true && !hasMaxTags;\n\n if( _s.mode == 'select' )\n this.toggleScopeValidation(tagValidation)\n\n // if the tag has become valid\n if( isValid ){\n tagData = tagData.__preInvalidData\n ? tagData.__preInvalidData\n : { value:tagData.value }\n\n return this.replaceTag(tagElm, tagData)\n }\n\n // if the tag is still invaild, set its title as such (reson of invalid might have changed)\n tagElm.title = hasMaxTags || tagValidation\n })\n },\n\n /**\n * Removes a tag\n * @param {Array|Node|String} tagElms [DOM element(s) or a String value. if undefined or null, remove last added tag]\n * @param {Boolean} silent [A flag, which when turned on, does not remove any value and does not update the original input value but simply removes the tag from tagify]\n * @param {Number} tranDuration [Transition duration in MS]\n * TODO: Allow multiple tags to be removed at-once\n */\n removeTags( tagElms, silent, tranDuration ){\n var tagsToRemove,\n _s = this.settings;\n\n tagElms = tagElms && tagElms instanceof HTMLElement\n ? [tagElms]\n : tagElms instanceof Array\n ? tagElms\n : tagElms\n ? [tagElms]\n : [this.getLastTag()].filter(n => n) // must filter because \"this.getLastTag()\" might be `undefined` if there are not tags\n\n // normalize tagElms array values:\n // 1. removing invalid items\n // 2, if an item is String try to get the matching Tag HTML node\n // 3. get the tag data\n // 4. return a collection of Objects\n tagsToRemove = tagElms.reduce((elms, tagElm) => {\n if( tagElm && typeof tagElm == 'string')\n tagElm = this.getTagElmByValue(tagElm)\n\n var tagData = getSetTagData(tagElm);\n\n if( tagElm && tagData && !tagData.readonly ) // make sure it's a tag and not some other node\n // because the DOM node might be removed by async animation, the state will be updated while\n // the node might still be in the DOM, so the \"update\" method should know which nodes to ignore\n elms.push({\n node: tagElm,\n idx: this.getTagIdx(tagData), // this.getNodeIndex(tagElm); // this.getTagIndexByValue(tagElm.textContent)\n data: getSetTagData(tagElm, {'__removed':true})\n })\n\n return elms\n }, [])\n\n tranDuration = typeof tranDuration == \"number\" ? tranDuration : this.CSSVars.tagHideTransition\n\n if( _s.mode == 'select' ){\n tranDuration = 0;\n this.input.set.call(this)\n }\n\n // if only a single tag is to be removed.\n // skip \"select\" mode because invalid tags are actually set to `this.value`\n if( tagsToRemove.length == 1 && _s.mode != 'select' ){\n if( tagsToRemove[0].node.classList.contains(_s.classNames.tagNotAllowed) )\n silent = true\n }\n\n if( !tagsToRemove.length )\n return;\n\n return _s.hooks.beforeRemoveTag(tagsToRemove, {tagify:this})\n .then(() => {\n function removeNode( tag ){\n if( !tag.node.parentNode ) return\n\n tag.node.parentNode.removeChild(tag.node)\n\n if( !silent ){\n // this.removeValueById(tagData.__uid)\n this.trigger('remove', { tag:tag.node, index:tag.idx, data:tag.data })\n this.dropdown.refilter()\n this.dropdown.position()\n this.DOM.input.normalize() // best-practice when in mix-mode (safe to do always anyways)\n\n // check if any of the current tags which might have been marked as \"duplicate\" should be un-marked\n if( _s.keepInvalidTags )\n this.reCheckInvalidTags()\n\n // below code is unfinished. it should iterate all currently invalid edited tags, which their edits have not\n // changed the value yet, and should re-trigger the check, but since nothing has changed, it does not work...\n // this.getTagElms(_s.classNames.tagEditing).forEach( this.events.callbacks.onEditTagBlur.bind )\n }\n else if( _s.keepInvalidTags )\n this.trigger('remove', { tag:tag.node, index:tag.idx })\n }\n\n function animation( tag ){\n tag.node.style.width = parseFloat(window.getComputedStyle(tag.node).width) + 'px'\n document.body.clientTop // force repaint for the width to take affect before the \"hide\" class below\n tag.node.classList.add(_s.classNames.tagHide)\n\n // manual timeout (hack, since transitionend cannot be used because of hover)\n setTimeout(removeNode.bind(this), tranDuration, tag)\n }\n\n if( tranDuration && tranDuration > 10 && tagsToRemove.length == 1 )\n animation.call(this, tagsToRemove[0])\n else\n tagsToRemove.forEach(removeNode.bind(this))\n\n // update state regardless of animation\n if( !silent ){\n this.removeTagsFromValue(tagsToRemove.map(tag => tag.node))\n this.update() // update the original input with the current value\n\n if( _s.mode == 'select' && _s.userInput )\n this.setContentEditable(true);\n }\n })\n .catch(reason => {})\n },\n\n removeTagsFromDOM(){\n this.getTagElms().forEach(node => node.remove())\n },\n\n /**\n * @param {Array/Node} tags to be removed from the this.value array\n */\n removeTagsFromValue( tags ){\n tags = Array.isArray(tags) ? tags : [tags];\n\n tags.forEach(tag => {\n var tagData = getSetTagData(tag),\n tagIdx = this.getTagIdx(tagData)\n\n // delete tagData.__removed\n\n if( tagIdx > -1 )\n this.value.splice(tagIdx, 1)\n })\n },\n\n removeAllTags( opts ){\n opts = opts || {}\n this.value = []\n\n if( this.settings.mode == 'mix' )\n this.DOM.input.innerHTML = ''\n else\n this.removeTagsFromDOM()\n\n this.dropdown.refilter()\n this.dropdown.position()\n\n if( this.state.dropdown.visible )\n setTimeout(() => {\n this.DOM.input.focus()\n })\n\n if( this.settings.mode == 'select' ){\n this.input.set.call(this)\n this.settings.userInput && this.setContentEditable(true)\n }\n\n // technically for now only \"withoutChangeEvent\" exists in the opts.\n // if more properties will be added later, only pass what's needed to \"update\"\n this.update(opts)\n },\n\n postUpdate(){\n this.state.blockChangeEvent = false\n\n var _s = this.settings,\n classNames = _s.classNames,\n hasValue = _s.mode == 'mix'\n ? _s.mixMode.integrated\n ? this.DOM.input.textContent\n : this.DOM.originalInput.value.trim()\n : this.value.length + this.input.raw.call(this).length;\n\n this.toggleClass(classNames.hasMaxTags, this.value.length >= _s.maxTags)\n this.toggleClass(classNames.hasNoTags, !this.value.length)\n this.toggleClass(classNames.empty, !hasValue)\n\n // specifically the \"select mode\" might have the \"invalid\" classname set when the field is changed, so it must be toggled on add/remove/edit\n if( _s.mode == 'select' ){\n this.toggleScopeValidation(this.value?.[0]?.__isValid)\n }\n },\n\n setOriginalInputValue( v ){\n var inputElm = this.DOM.originalInput;\n\n if( !this.settings.mixMode.integrated ){\n inputElm.value = v\n inputElm.tagifyValue = inputElm.value // must set to \"inputElm.value\" and not again to \"inputValue\" because for some reason the browser changes the string afterwards a bit.\n this.setPersistedData(v, 'value')\n }\n },\n\n /**\n * update the origianl (hidden) input field's value\n * see - https://stackoverflow.com/q/50957841/104380\n */\n update( args ){\n const UPDATE_DELAY = 100\n clearTimeout(this.debouncedUpdateTimeout)\n this.debouncedUpdateTimeout = setTimeout(reallyUpdate.bind(this), UPDATE_DELAY)\n this.events.bindOriginaInputListener.call(this, UPDATE_DELAY)\n\n function reallyUpdate() {\n var inputValue = this.getInputValue();\n\n this.setOriginalInputValue(inputValue)\n\n if( (!this.settings.onChangeAfterBlur || !(args||{}).withoutChangeEvent) && !this.state.blockChangeEvent )\n this.triggerChangeEvent()\n\n this.postUpdate()\n }\n },\n\n getInputValue(){\n var value = this.getCleanValue();\n\n return this.settings.mode == 'mix'\n ? this.getMixedTagsAsString(value)\n : value.length\n ? this.settings.originalInputValueFormat\n ? this.settings.originalInputValueFormat(value)\n : JSON.stringify(value)\n : \"\"\n },\n\n /**\n * removes properties from `this.value` which are only used internally\n */\n getCleanValue(v){\n return removeCollectionProp(v || this.value, this.dataProps);\n },\n\n getMixedTagsAsString(){\n var result = \"\",\n that = this,\n _s = this.settings,\n originalInputValueFormat = _s.originalInputValueFormat || JSON.stringify,\n _interpolator = _s.mixTagsInterpolator;\n\n function iterateChildren(rootNode){\n rootNode.childNodes.forEach((node) => {\n if( node.nodeType == 1 ){\n const tagData = getSetTagData(node);\n\n if( node.tagName == 'BR' ){\n result += \"\\r\\n\";\n }\n\n if( tagData && isNodeTag.call(that, node) ){\n if( tagData.__removed )\n return;\n else\n result += _interpolator[0] + originalInputValueFormat( omit(tagData, that.dataProps) ) + _interpolator[1]\n }\n else if( node.getAttribute('style') || ['B', 'I', 'U'].includes(node.tagName) )\n result += node.textContent;\n\n else if( node.tagName == 'DIV' || node.tagName == 'P' ){\n result += \"\\r\\n\";\n // if( !node.children.length && node.textContent )\n // result += node.textContent;\n iterateChildren(node)\n }\n }\n else\n result += node.textContent;\n })\n }\n\n iterateChildren(this.DOM.input)\n\n return result;\n }\n}\n\n// legacy support for changed methods names\nTagify.prototype.removeTag = Tagify.prototype.removeTags\n\nexport default Tagify\n", "import { extend, logger } from './helpers'\r\n\r\nexport default function EventDispatcher( instance ){\r\n // Create a DOM EventTarget object\r\n var target = document.createTextNode(''),\r\n // keep track of all binded events & their callbacks to be able to completely remove all listeners of a speicific type\r\n callbacksPerType = {}\r\n\r\n function addRemove(op, events, cb){\r\n if( cb )\r\n events.split(/\\s+/g).forEach(ev => target[op + 'EventListener'].call(target, ev, cb))\r\n }\r\n\r\n // Pass EventTarget interface calls to DOM EventTarget object\r\n return {\r\n // unbinds all events\r\n removeAllCustomListeners(){\r\n Object.entries(callbacksPerType).forEach(([ev, cbArr]) => {\r\n cbArr.forEach(cb => addRemove('remove', ev, cb))\r\n })\r\n\r\n callbacksPerType = {}\r\n },\r\n\r\n off(events, cb){\r\n if( events ) {\r\n if( cb )\r\n addRemove('remove', events, cb)\r\n else\r\n // if `cb` argument was not specified then remove all listeners for the given event(s) types\r\n events.split(/\\s+/g).forEach(ev => {\r\n callbacksPerType[ev]?.forEach(cb => addRemove('remove', ev, cb))\r\n delete callbacksPerType[ev]\r\n })\r\n }\r\n\r\n return this\r\n },\r\n\r\n on(events, cb){\r\n if(cb && typeof cb == 'function') {\r\n //track events callbacks to be able to remove them altogehter\r\n events.split(/\\s+/g).forEach(ev => {\r\n if (Array.isArray(callbacksPerType[ev]) )\r\n callbacksPerType[ev].push(cb)\r\n else\r\n callbacksPerType[ev] = [cb]\r\n })\r\n\r\n addRemove('add', events, cb)\r\n }\r\n\r\n return this\r\n },\r\n\r\n trigger(eventName, data, opts){\r\n var e;\r\n\r\n opts = opts || {\r\n cloneData:true\r\n }\r\n\r\n if( !eventName ) return;\r\n\r\n if( instance.settings.isJQueryPlugin ){\r\n if( eventName == 'remove' ) eventName = 'removeTag' // issue #222\r\n jQuery(instance.DOM.originalInput).triggerHandler(eventName, [data])\r\n }\r\n else{\r\n try {\r\n var eventData = typeof data === 'object'\r\n ? data\r\n : {value:data};\r\n\r\n eventData = opts.cloneData ? extend({}, eventData) : eventData\r\n eventData.tagify = this\r\n\r\n if( data.event )\r\n eventData.event = this.cloneEvent(data.event)\r\n\r\n // TODO: move the below to the \"extend\" function\r\n if( data instanceof Object )\r\n for( var prop in data )\r\n if(data[prop] instanceof HTMLElement)\r\n eventData[prop] = data[prop]\r\n\r\n e = new CustomEvent(eventName, {\"detail\":eventData})\r\n }\r\n catch(err){ logger.warn(err) }\r\n\r\n target.dispatchEvent(e);\r\n }\r\n }\r\n }\r\n}\r\n", "import { Controller } from '@hotwired/stimulus'\nimport Tagify from '@yaireo/tagify'\n\nexport class TagsController extends Controller<HTMLInputElement> {\n tagify?: Tagify<Tagify.TagData>\n\n connect(): void {\n this.tagify = new Tagify(this.element, {\n originalInputValueFormat: valuesArr => {\n return JSON.stringify(valuesArr.map(item => item.value))\n },\n })\n }\n\n disconnect(): void {\n this.tagify?.destroy()\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport class ToggleContentController extends Controller {\n static values = {\n content: String,\n }\n\n previousContent?: string\n\n declare contentValue?: string\n\n connect(): void {\n this.previousContent = this.element.innerHTML\n this.element.addEventListener('click', this.toggle)\n }\n\n disconnect(): void {\n this.element.removeEventListener('click', this.toggle)\n }\n\n toggle = (): void => {\n if (this.element.innerHTML === this.previousContent) {\n this.element.innerHTML = this.contentValue || ''\n } else {\n this.element.innerHTML = this.previousContent || ''\n }\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport class CheckboxButtonController extends Controller<HTMLButtonElement> {\n static outlets: string[] = ['label']\n\n declare readonly labelOutlet: HTMLLinkElement\n\n public handleClick = (_event: Event) => {\n console.log('handleClick')\n const nextState = this.element.ariaChecked === 'true' ? 'false' : 'true'\n const taskElement: HTMLLIElement | null =\n this.element.closest('[id^=\"task_\"]')\n console.log('taskElement', taskElement)\n\n this.element.setAttribute('aria-checked', nextState)\n\n if (taskElement) {\n if (nextState === 'true') {\n taskElement.dataset.taskComplete = 'true'\n } else {\n taskElement.dataset.taskComplete = 'false'\n }\n }\n\n this.submitForm()\n }\n\n private submitForm(): void {\n setTimeout(() => {\n this.element.form?.requestSubmit()\n }, 350)\n }\n}\n", "import { h } from 'preact'\nimport { isAfter, isSameDay, isToday } from 'date-fns'\nimport classNames from 'classnames'\nimport { DayObject } from '../WeekPicker'\n\ninterface Props {\n date?: Date\n year: number\n month: number\n week: DayObject[]\n onClick: (date: Date) => void\n}\n\nexport function WeekRow({ date, month, year, week, onClick }: Props) {\n return (\n <div class=\"grid grid-cols-7 rounded-lg\">\n {week.map(day => {\n const currentDate = new Date(year, month, day.day)\n const isFuture = isAfter(currentDate, new Date())\n const isDateToday = isToday(currentDate)\n const isCurrent = isDateToday || isFuture\n const isSelected = !!date && isSameDay(date, currentDate)\n\n if (day.type === 'blank') {\n return (\n <div\n key={`dayInMonth_${day.day}`}\n class=\"p-1 text-sm text-center border border-transparent\"\n ></div>\n )\n }\n\n return (\n <div\n key={`dayInMonth_${day.day}`}\n class=\"px-0.5 my-0.5 aspect-square flex items-center justify-center\"\n >\n <button\n disabled={!isCurrent}\n onClick={() => onClick(currentDate)}\n class={classNames(\n 'flex items-center justify-center text-sm leading-none text-center rounded-full h-7 w-7',\n {\n 'text-gray-200 dark:text-neutral-600': !isCurrent,\n 'bg-gray-200 dark:bg-neutral-600': isDateToday,\n 'text-gray-600 dark:text-neutral-400':\n !isDateToday || !date || isSameDay(date, currentDate),\n 'bg-primary-800 text-white dark:text-white': isSelected,\n 'hover:bg-gray-300 dark:hover:bg-neutral-600': isCurrent,\n }\n )}\n >\n {day.day}\n </button>\n </div>\n )\n })}\n </div>\n )\n}\n", "import { h } from 'preact'\nimport { useEffect, useState, useRef, useCallback } from 'preact/hooks'\nimport {\n addDays,\n addWeeks,\n format,\n isBefore,\n isPast,\n isSameMonth,\n isThisWeek,\n isToday,\n isTomorrow,\n nextMonday,\n startOfTomorrow,\n} from 'date-fns'\nimport { PreviousMonthButton } from './WeekPicker/PreviousMonthButton'\nimport { NextMonthButton } from './WeekPicker/NextMonthButton'\nimport { WeekRow } from './DateTimePicker/WeekRow'\nimport classNames from 'classnames'\n\nconst DAY_NAMES = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']\nconst MONTH_NAMES: string[] = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n]\n\nfunction formatDateText(date?: Date): string {\n if (!date) return 'Due date'\n\n if (isPast(date)) return format(date, 'd LLL yyyy')\n\n if (isThisWeek(date) || isBefore(date, addWeeks(new Date(), 1)))\n return format(date, 'EEEE')\n\n if (isSameMonth(date, new Date())) return format(date, 'd LLL')\n\n return format(date, 'd LLL yyyy')\n}\n\nfunction groupArray<T>(array: T[], num: number): T[][] {\n const group: T[][] = []\n\n for (let i = 0; i < array.length; i += num) {\n group.push(array.slice(i, i + num))\n }\n\n return group\n}\n\nfunction useOutsideClick(ref: any, onClickOut: () => void, deps: any[] = []) {\n useEffect(() => {\n const onClick = ({ target }: any) => {\n !ref?.contains(target) && onClickOut?.()\n }\n document.addEventListener('click', onClick)\n return () => document.removeEventListener('click', onClick)\n }, deps)\n}\n\ninterface Props {\n date?: Date\n time?: string\n onChangeDate: (date?: Date) => void\n onChangeTime: (time?: string) => void\n}\n\nexport interface DayObject {\n day: number\n type: 'blank' | 'normal'\n}\n\nexport function DateTimePicker({\n date: initialDate,\n date: defaultDate = new Date(),\n onChangeDate,\n onChangeTime,\n}: Props) {\n const [open, setOpen] = useState(false)\n const [date, setDate] = useState(initialDate)\n const [month, setMonth] = useState(defaultDate.getMonth())\n const [year, setYear] = useState(defaultDate.getFullYear())\n const [blankDaysInMonth, setBlankDaysInMonth] = useState<number[]>([])\n const [daysInMonth, setDaysInMonth] = useState<number[]>([])\n\n const containerRef = useRef<HTMLDivElement>()\n const today = useRef(new Date()).current\n const isDateToday = !!date && isToday(date)\n const isDateTomorrow = !!date && isTomorrow(date)\n\n const allDays: DayObject[] = [\n ...blankDaysInMonth.map(day => ({\n day,\n type: 'blank',\n })),\n ...daysInMonth.map(day => ({\n day,\n type: 'normal',\n })),\n ]\n const groupedDays = groupArray(allDays, 7)\n const atMinMonth = today.getFullYear() === year && today.getMonth() === month\n\n useEffect(() => {\n document.addEventListener('keyup', closeWithKeyboard)\n\n return () => {\n document.removeEventListener('keyup', closeWithKeyboard)\n }\n }, [])\n\n useOutsideClick(\n containerRef.current,\n () => {\n setOpen(false)\n },\n [containerRef.current]\n )\n\n const toggleOpen = useCallback(() => {\n setOpen(currentValue => !currentValue)\n }, [])\n\n function datePickerCalculateDays() {\n const totalDaysInMonth = new Date(year, month + 1, 0).getDate()\n // find where to start calendar day of week\n const dayOfWeek = new Date(year, month).getDay()\n const dayIndex = dayOfWeek === 0 ? 6 : dayOfWeek - 1\n const blankDaysArray: number[] = []\n\n for (var i = 1; i <= dayIndex; i++) {\n blankDaysArray.push(i)\n }\n\n const daysArray: number[] = []\n for (var i = 1; i <= totalDaysInMonth; i++) {\n daysArray.push(i)\n }\n\n setBlankDaysInMonth(blankDaysArray)\n setDaysInMonth(daysArray)\n }\n\n useEffect(() => {\n datePickerCalculateDays()\n }, [date])\n\n useEffect(() => {\n datePickerCalculateDays()\n }, [month])\n\n const closeWithKeyboard = useCallback((event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpen(false)\n }\n }, [])\n\n const onDateClick = useCallback(\n (date?: Date) => {\n setDate(date)\n setOpen(false)\n onChangeDate(date)\n },\n [onChangeDate]\n )\n\n const selectToday = useCallback(() => {\n const date = new Date()\n onDateClick(date)\n }, [onChangeDate])\n\n const selectTomorrow = useCallback(() => {\n const date = addDays(new Date(), 1)\n onDateClick(date)\n }, [onDateClick])\n\n const selectNextWeek = useCallback(() => {\n const date = nextMonday(new Date())\n onDateClick(date)\n }, [onDateClick])\n\n const clearDate = useCallback(() => {\n onDateClick()\n }, [onDateClick])\n\n function datePickerPreviousMonth() {\n if (atMinMonth) return\n\n if (month === 0) {\n setYear(year - 1)\n setMonth(11)\n } else {\n setMonth(month - 1)\n }\n }\n\n function datePickerNextMonth() {\n if (month === 11) {\n setMonth(0)\n setYear(year + 1)\n } else {\n setMonth(month + 1)\n }\n }\n\n return (\n <div ref={containerRef} class=\"container block mb-1\">\n <div class=\"w-full\">\n <label id=\"listbox-label\" class=\"sr-only\">\n Add a due date\n </label>\n <div class=\"relative\">\n <button\n onClick={toggleOpen}\n type=\"button\"\n data-action=\"click->dropdown#toggle click@window->dropdown#hide\"\n data-dropdown-target=\"button\"\n className=\"relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 rounded-full dark:text-neutral-300 whitespace-nowrap bg-gray-50 dark:bg-neutral-700 hover:bg-gray-100 dark:hover:bg-neutral-600 sm:px-3\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"true\"\n aria-labelledby=\"listbox-label\"\n >\n <svg\n class={classNames('flex-shrink-0 w-5 h-5 sm:-ml-1', {\n 'text-gray-500 dark:text-neutral-300': !!date,\n 'text-gray-300 dark:text-neutral-500': !date,\n 'text-red-700 dark:text-red-500': !!date && isPast(date),\n })}\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M5.75 2a.75.75 0 01.75.75V4h7V2.75a.75.75 0 011.5 0V4h.25A2.75 2.75 0 0118 6.75v8.5A2.75 2.75 0 0115.25 18H4.75A2.75 2.75 0 012 15.25v-8.5A2.75 2.75 0 014.75 4H5V2.75A.75.75 0 015.75 2zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n <span\n class={classNames('hidden truncate sm:ml-2 sm:block', {\n 'text-gray-900 dark:text-neutral-300': !!date,\n 'text-red-700 dark:text-red-500': !!date && isPast(date),\n })}\n >\n {formatDateText(date)}\n </span>\n </button>\n\n {open && (\n <div class=\"absolute -bottom-52 left-[6.7rem] max-w-lg px-4 py-2 mt-12 antialiased bg-white dark:bg-neutral-800 border rounded-lg shadow w-[17rem] border-gray-200/70 dark:border-neutral-700\">\n <div class=\"flex flex-col items-stretch -mx-4 pb-2 mb-2 border-b border-gray-200/70 dark:border-neutral-700\">\n {!isDateToday && (\n <button\n onClick={selectToday}\n type=\"button\"\n class=\"px-4 py-2 text-left text-sm flex justify-between text-gray-900 dark:text-neutral-300 hover:bg-gray-100 dark:hover:bg-neutral-700\"\n >\n <span>Today</span>\n <span>{format(new Date(), 'EEE')}</span>\n </button>\n )}\n {!isDateTomorrow && (\n <button\n onClick={selectTomorrow}\n type=\"button\"\n class=\"px-4 py-2 text-left text-sm flex justify-between text-gray-900 dark:text-neutral-300 hover:bg-gray-100 dark:hover:bg-neutral-700\"\n >\n <span>Tomorrow</span>\n <span>{format(startOfTomorrow(), 'EEE')}</span>\n </button>\n )}\n <button\n onClick={selectNextWeek}\n type=\"button\"\n class=\"px-4 py-2 text-left text-sm flex justify-between text-gray-900 dark:text-neutral-300 hover:bg-gray-100 dark:hover:bg-neutral-700\"\n >\n <span>Next week</span>\n <span>{format(nextMonday(new Date()), 'EEE LLL d')}</span>\n </button>\n {!!date && (\n <button\n onClick={clearDate}\n type=\"button\"\n class=\"px-4 py-2 text-left text-sm text-gray-900 dark:text-neutral-300 hover:bg-gray-100 dark:hover:bg-neutral-700\"\n >\n No date\n </button>\n )}\n </div>\n <div class=\"flex items-center justify-between mb-2\">\n <div>\n <span class=\"text-lg font-bold text-gray-800 dark:text-neutral-300\">\n {MONTH_NAMES[month]}\n </span>\n <span class=\"ml-1 text-lg font-normal text-gray-600 dark:text-neutral-500\">\n {year}\n </span>\n </div>\n <div>\n <PreviousMonthButton\n onPress={datePickerPreviousMonth}\n disabled={atMinMonth}\n />\n <NextMonthButton onPress={datePickerNextMonth} />\n </div>\n </div>\n <div class=\"grid grid-cols-7 mb-3\">\n {DAY_NAMES.map(day => (\n <div key={day} class=\"px-0.5\">\n <div class=\"text-xs font-medium text-center text-gray-800 dark:text-neutral-400\">\n {day}\n </div>\n </div>\n ))}\n </div>\n {groupedDays.map(group => (\n <WeekRow\n key={group}\n date={date}\n week={group}\n month={month}\n year={year}\n onClick={onDateClick}\n />\n ))}\n </div>\n )}\n </div>\n </div>\n </div>\n )\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { h, render } from 'preact'\nimport { format } from 'date-fns'\nimport { DateTimePicker } from '../components/DateTimePicker'\n\nexport class DateTimePickerController extends Controller<HTMLFormElement> {\n static targets: string[] = ['container', 'dateInput', 'timeInput']\n static values = {\n date: String,\n time: String,\n }\n\n declare readonly containerTarget: HTMLInputElement\n declare readonly dateInputTarget: HTMLInputElement\n declare readonly timeInputTarget: HTMLInputElement\n declare dateValue: string\n declare timeValue: string\n\n connect(): void {\n let date: Date | undefined\n\n if (this.dateValue) {\n // date = new Date(Date.parse(this.dateValue))\n date = new Date(this.dateValue)\n }\n\n render(\n <DateTimePicker\n date={date}\n time={this.timeValue}\n onChangeDate={this.onChangeDate}\n onChangeTime={this.onChangeTime}\n />,\n this.containerTarget\n )\n }\n\n onChangeDate = (date?: Date) => {\n this.dateInputTarget.value = date ? format(date, 'yyyy-MM-dd') : ''\n this.dateInputTarget.dispatchEvent(\n new Event('change', {\n bubbles: true,\n cancelable: true,\n })\n )\n }\n\n onChangeTime = (time?: string) => {\n this.timeInputTarget.value = time || ''\n this.timeInputTarget.dispatchEvent(\n new Event('change', {\n bubbles: true,\n cancelable: true,\n })\n )\n }\n}\n", "import { ActionEvent, Controller } from '@hotwired/stimulus'\n\nexport class AssigneePickerController extends Controller<HTMLDivElement> {\n static targets: string[] = ['name', 'avatar', 'input']\n\n declare readonly nameTarget: HTMLSpanElement\n declare readonly avatarTarget: HTMLDivElement\n declare readonly inputTarget: HTMLInputElement\n\n selectAssignee = (event: ActionEvent) => {\n const id = event.params.id\n const name = (event.currentTarget as HTMLElement)?.querySelector(\n `[data-target=\"name\"]`\n )\n const avatar = (event.currentTarget as HTMLElement)?.querySelector(\n `[data-target=\"avatar\"]`\n )\n\n if (name) {\n this.nameTarget.innerHTML = name.innerHTML\n }\n if (avatar) {\n this.avatarTarget.innerHTML = avatar.innerHTML\n }\n\n this.inputTarget.value = id\n this.inputTarget.dispatchEvent(\n new Event('change', {\n bubbles: true,\n cancelable: true,\n })\n )\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport class AutoSubmitController extends Controller<HTMLFormElement> {\n connect(): void {\n this.element.addEventListener('change', this.submitForm)\n }\n\n disconnect(): void {\n this.element.removeEventListener('change', this.submitForm)\n }\n\n submitForm = (): void => {\n this.element.requestSubmit()\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { Turbo } from '@hotwired/turbo-rails'\n\nexport class LinkController extends Controller {\n static values = { url: String }\n\n declare urlValue: string\n\n visit() {\n const frame = this.element.closest('turbo-frame')\n if (frame) {\n Turbo.visit(this.urlValue, { frame: frame.id })\n // frame.src = this.urlValue\n } else {\n Turbo.visit(this.urlValue)\n }\n }\n}\n", "// This file is auto-generated by ./bin/rails stimulus:manifest:update\n// Run that command whenever you add a new controller or create them with\n// ./bin/rails generate stimulus controllerName\n\nimport { application } from './application'\nimport AppController from './app_controller'\nimport AwardFormController from './award_form_controller'\nimport ChartController from './chart_controller'\nimport CheckboxSelectAll from 'stimulus-checkbox-select-all'\nimport Flatpickr from 'stimulus-flatpickr'\nimport CommandPaletteController from './command_palette_controller'\nimport CustomFieldController from './custom_field_form'\nimport DashboardController from './dashboard_controller'\nimport DateFilterController from './date_filter_controller'\nimport FiltersController from './filters_controller'\nimport FireworksController from './fireworks_controller'\nimport GroupedSelectController from './grouped_select_controller'\n// import Hovercard from './hovercard_controller'\nimport { NestedFormController } from './nested_form_controller'\nimport MessageComposerController from './message_composer_controller'\nimport MessagesListController from './messages_list_controller'\nimport NoteComposerController from './note_composer_controller'\nimport Notification from 'stimulus-notification'\nimport PermissionsController from './permissions_controller'\nimport SearchFormController from './search_form_controller'\nimport SortableController from './sortable_controller'\nimport TransitionController from './transition_controller'\nimport TurboController from './turbo_controller'\nimport TurboModalController from './turbo_modal_controller'\nimport { CancellationFormController } from './cancellation_form_controller'\nimport { CurrentConversationController } from './current_conversation_controller'\nimport { DropdownController } from './dropdown_controller'\nimport { AutosizeController, TimeDistanceController } from 'stimulus-library'\nimport { WeighInController } from './weigh_in_controller'\nimport { TooltipController } from './tooltip_controller'\nimport { ModalController } from './modal_controller'\nimport { AvatarPickerController } from './avatar_picker_controller'\nimport { WeekFilterController } from './week_filter_controller'\nimport { ScrollToBottomController } from './scroll_to_bottom_controller'\nimport { EditorController } from './editor_controller'\nimport { ArticleFormController } from './article_form_controller'\nimport { TagsController } from './tags_controller'\nimport { ToggleContentController } from '././toggle-content-controller'\nimport { CheckboxButtonController } from './checkbox_button_controller'\nimport { DateTimePickerController } from './date_time_picker_controller'\n// import { ConversationsController } from './conversations_controller'\nimport { AssigneePickerController } from './consultant-portal/tasks/assignee_picker_controller'\nimport { AutoSubmitController } from './consultant-portal/auto-submit-controller'\nimport { LinkController } from './link-controller'\n\napplication.register('dashboard', DashboardController)\napplication.register('date-filter', DateFilterController)\napplication.register('nested-form', NestedFormController)\napplication.register('award-form', AwardFormController)\napplication.register('search-form', SearchFormController)\napplication.register('dropdown', DropdownController)\napplication.register('notification', Notification)\napplication.register('turbo-modal', TurboModalController)\napplication.register('transition', TransitionController)\napplication.register('grouped-select', GroupedSelectController)\napplication.register('chart', ChartController)\napplication.register('app', AppController)\napplication.register('filters', FiltersController)\napplication.register('fireworks', FireworksController)\napplication.register('sortable', SortableController)\napplication.register('checkbox-select-all', CheckboxSelectAll)\napplication.register('permissions', PermissionsController)\napplication.register('turbo', TurboController)\napplication.register('custom-field-form', CustomFieldController)\napplication.register('command-palette', CommandPaletteController)\napplication.register('time-distance', TimeDistanceController)\napplication.register('message-composer', MessageComposerController)\napplication.register('messages-list', MessagesListController)\napplication.register('note-composer', NoteComposerController)\napplication.register('cancellation-form', CancellationFormController)\napplication.register('weigh-in', WeighInController)\napplication.register('current-conversation', CurrentConversationController)\napplication.register('tooltip', TooltipController)\napplication.register('modal', ModalController)\napplication.register('avatar-picker', AvatarPickerController)\napplication.register('week-filter', WeekFilterController)\napplication.register('scroll-to-bottom', ScrollToBottomController)\napplication.register('editor', EditorController)\napplication.register('article-form', ArticleFormController)\napplication.register('tags', TagsController)\napplication.register('flatpickr', Flatpickr)\napplication.register('toggle-content', ToggleContentController)\napplication.register('autosize', AutosizeController)\napplication.register('checkbox-button', CheckboxButtonController)\napplication.register('assignee-picker', AssigneePickerController)\napplication.register('date-time-picker', DateTimePickerController)\napplication.register('auto-submit', AutoSubmitController)\napplication.register('link', LinkController)\n// application.register('conversations', ConversationsController)\n// application.register('hovercard', Hovercard)\n", "// import { StreamElement } from '@hotwired/turbo-rails'\n\nexport function scroll_into_view(this: any) {\n const alignToTop = this.getAttribute('align-to-top')\n const block = this.getAttribute('block') as ScrollLogicalPosition\n const inline = this.getAttribute('inline') as ScrollLogicalPosition\n const behavior = this.getAttribute('behavior') as ScrollBehavior\n\n if (alignToTop) {\n this.targetElements.forEach((element: Element) =>\n element.scrollIntoView(alignToTop === 'true')\n )\n } else if (block || inline || behavior) {\n const options: ScrollIntoViewOptions = {}\n\n if (block) options.block = block\n if (inline) options.inline = inline\n if (behavior) options.behavior = behavior\n\n this.targetElements.forEach((element: Element) =>\n element.scrollIntoView(options)\n )\n } else {\n this.targetElements.forEach((element: Element) => element.scrollIntoView())\n }\n}\n", "export function set_theme() {\n const theme = this.getAttribute('theme')\n\n if (theme === 'dark') {\n document.documentElement.classList.remove('light')\n } else if (theme === 'light') {\n document.documentElement.classList.remove('dark')\n } else {\n const prefersDark = window.matchMedia(\n '(prefers-color-scheme: dark)'\n ).matches\n\n if (prefersDark) {\n document.documentElement.classList.remove('light')\n } else {\n document.documentElement.classList.remove('dark')\n }\n }\n\n document.documentElement.classList.add(theme)\n}\n", "export function redirect_to() {\n const url = this.getAttribute('url') || '/'\n const turboAction = this.getAttribute('turbo-action') || 'advance'\n const turboFrame = this.getAttribute('turbo-frame')\n const turbo = this.getAttribute('turbo') !== 'false'\n const options = {\n action: turboAction,\n }\n\n if (turboFrame) {\n options.frame = turboFrame\n }\n\n if (turbo && window.Turbo) {\n window.Turbo.visit(url, options)\n } else {\n Proxy.location.assign(url)\n }\n}\n\nexport function turbo_clear_cache() {\n window.Turbo.cache.clear()\n}\n", "import { Turbo } from '@hotwired/turbo-rails'\nimport * as ActiveStorage from '@rails/activestorage'\nimport './controllers'\nimport { scroll_into_view } from './stream-actions/browser'\nimport { set_theme } from './stream-actions/dom'\nimport { turbo_clear_cache } from './stream-actions/turbo'\n\nActiveStorage.start()\n\nTurbo.setConfirmMethod((message, element) => {\n const dialogId = element.dataset.dialogTarget\n const dialog = document.getElementById(dialogId)\n\n if (!dialog) return window.confirm(message)\n\n dialog.showModal()\n\n return new Promise(resolve => {\n dialog.addEventListener(\n 'close',\n () => {\n resolve(dialog.returnValue === 'confirm')\n },\n { once: true }\n )\n })\n})\n\nTurbo.StreamActions.set_theme = set_theme\nTurbo.StreamActions.scroll_into_view = scroll_into_view\nTurbo.StreamActions.turbo_clear_cache = turbo_clear_cache\n\nwindow\n .matchMedia('(prefers-color-scheme: dark)')\n .addEventListener('change', e => {\n const isSystem = document.documentElement.classList.contains('system')\n const wantsDark = e.matches\n\n if (isSystem) {\n if (wantsDark) {\n document.documentElement.classList.add('dark')\n } else {\n document.documentElement.classList.remove('dark')\n }\n }\n })\n"], "mappings": "yoBAAA,IAAOA,GAAPC,GAAAC,GAAA,KAAOF,GAAQ,CACb,OAAQ,OAAO,QAAY,IAAc,QAAU,OACnD,UAAW,OAAO,UAAc,IAAc,UAAY,MAC5D,ICHA,IAcOG,GAdPC,GAAAC,GAAA,KAAAC,KAcOH,GAAQ,CACb,OAAOI,EAAU,CACX,KAAK,UACPA,EAAS,KAAK,KAAK,IAAI,CAAC,EACxBC,GAAS,OAAO,IAAI,gBAAiB,GAAGD,CAAQ,EAEpD,CACF,ICrBA,IAKME,GAEAC,GAEAC,GAkHCC,GA3HPC,GAAAC,GAAA,KAAAC,KAKMN,GAAM,IAAM,IAAI,KAAK,EAAE,QAAQ,EAE/BC,GAAeM,IAASP,GAAI,EAAIO,GAAQ,IAExCL,GAAN,KAAwB,CACtB,YAAYM,EAAY,CACtB,KAAK,oBAAsB,KAAK,oBAAoB,KAAK,IAAI,EAC7D,KAAK,WAAaA,EAClB,KAAK,kBAAoB,CAC3B,CAEA,OAAQ,CACD,KAAK,UAAU,IAClB,KAAK,UAAYR,GAAI,EACrB,OAAO,KAAK,UACZ,KAAK,aAAa,EAClB,iBAAiB,mBAAoB,KAAK,mBAAmB,EAC7DS,GAAO,IAAI,gDAAgD,KAAK,YAAY,cAAc,IAAI,EAElG,CAEA,MAAO,CACD,KAAK,UAAU,IACjB,KAAK,UAAYT,GAAI,EACrB,KAAK,YAAY,EACjB,oBAAoB,mBAAoB,KAAK,mBAAmB,EAChES,GAAO,IAAI,2BAA2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EACA,CAAE,KAAM,EAAK,CACf,CACF,CAAC,GAZmB,OAAO,QAAQH,CAAO,CAa5C,CAAC,EAEDD,GAAM,cAAc,UAAYM,GAChCN,GAAM,cAAc,iBAAmBO,GACvCP,GAAM,cAAc,kBAAoBQ,GAExC,OACG,WAAW,8BAA8B,EACzC,iBAAiB,SAAUC,GAAK,CAC/B,IAAMC,EAAW,SAAS,gBAAgB,UAAU,SAAS,QAAQ,EAC/DC,EAAYF,EAAE,QAEhBC,IACEC,EACF,SAAS,gBAAgB,UAAU,IAAI,MAAM,EAE7C,SAAS,gBAAgB,UAAU,OAAO,MAAM,EAGtD,CAAC", "names": ["adapters_default", "init_adapters", "__esmMin", "logger_default", "init_logger", "__esmMin", "init_adapters", "messages", "adapters_default", "now", "secondsSince", "ConnectionMonitor", "connection_monitor_default", "init_connection_monitor", "__esmMin", "init_logger", "time", "connection", "logger_default", "staleThreshold", "reconnectionBackoffRate", "backoff", "jitter", "internal_default", "init_internal", "__esmMin", "message_types", "protocols", "supportedProtocols", "indexOf", "Connection", "connection_default", "init_connection", "__esmMin", "init_adapters", "init_connection_monitor", "init_internal", "init_logger", "internal_default", "consumer", "connection_monitor_default", "data", "logger_default", "socketProtocols", "adapters_default", "allowReconnect", "error", "states", "state", "eventName", "handler", "event", "identifier", "message", "reason", "reconnect", "type", "extend", "Subscription", "init_subscription", "__esmMin", "object", "properties", "key", "value", "consumer", "params", "mixin", "action", "data", "SubscriptionGuarantor", "subscription_guarantor_default", "init_subscription_guarantor", "__esmMin", "init_logger", "subscriptions", "subscription", "logger_default", "s", "Subscriptions", "init_subscriptions", "__esmMin", "init_subscription", "init_subscription_guarantor", "init_logger", "consumer", "subscription_guarantor_default", "channelName", "mixin", "channel", "params", "subscription", "Subscription", "identifier", "s", "callbackName", "args", "subscriptions", "logger_default", "command", "createWebSocketURL", "url", "a", "Consumer", "init_consumer", "__esmMin", "init_connection", "init_subscriptions", "Subscriptions", "connection_default", "data", "subprotocol", "src_exports", "__export", "connection_default", "connection_monitor_default", "Consumer", "internal_default", "Subscription", "subscription_guarantor_default", "Subscriptions", "adapters_default", "createConsumer", "createWebSocketURL", "getConfig", "logger_default", "url", "name", "element", "init_src", "__esmMin", "init_connection", "init_connection_monitor", "init_consumer", "init_internal", "init_subscription", "init_subscriptions", "init_subscription_guarantor", "init_adapters", "init_logger", "require_croppie", "__commonJSMin", "exports", "module", "root", "factory", "a", "b", "c", "i", "e", "f", "d", "k", "g", "h", "j", "l", "CustomEvent", "event", "params", "evt", "callback", "type", "quality", "binStr", "len", "arr", "cssPrefixes", "emptyStyles", "EXIF_NORM", "EXIF_FLIP", "CSS_TRANS_ORG", "CSS_TRANSFORM", "CSS_USERSELECT", "vendorPrefix", "prop", "capProp", "getExifOffset", "ornt", "rotate", "index", "offset", "deepExtend", "destination", "source", "property", "clone", "object", "debounce", "func", "wait", "immediate", "timeout", "context", "args", "later", "callNow", "dispatchChange", "element", "css", "el", "styles", "val", "tmp", "addClass", "removeClass", "setAttributes", "attrs", "key", "num", "v", "loadImage", "src", "doExif", "img", "resolve", "reject", "_resolve", "ev", "naturalImageDimensions", "w", "orient", "getExifOrientation", "x", "TRANSLATE_OPTS", "Transform", "y", "scale", "vals", "values", "translate", "Croppie", "suffix", "TransformOrigin", "drawCanvas", "canvas", "orientation", "width", "height", "ctx", "_create", "self", "contClass", "customViewportClass", "boundary", "viewport", "overlay", "bw", "bh", "_hasExif", "_initDraggable", "_initializeZoom", "_initializeResize", "wrap", "isDragging", "direction", "originalX", "originalY", "minSize", "maxWidth", "maxHeight", "vr", "hr", "mouseDown", "overlayRect", "touches", "mouseMove", "mouseUp", "pageX", "pageY", "deltaX", "deltaY", "newHeight", "newWidth", "_updateOverlay", "_updateZoomLimits", "_updateCenterPoint", "_triggerUpdate", "_setZoomerVal", "z", "fix", "zoomer", "change", "_onZoom", "scroll", "delta", "targetZoom", "ui", "transform", "vpRect", "origin", "applyCss", "transCss", "boundaries", "_getVirtualBoundaries", "transBoundaries", "oBoundaries", "_debouncedOverlay", "vpWidth", "vpHeight", "centerFromBoundaryX", "centerFromBoundaryY", "imgRect", "curImgWidth", "curImgHeight", "halfWidth", "halfHeight", "maxX", "minX", "maxY", "minY", "originMinX", "originMaxX", "originMinY", "originMaxY", "data", "vpData", "pc", "top", "left", "center", "adj", "cx", "cy", "tx", "ty", "newCss", "originalDistance", "assignTransformCoordinates", "toggleGrabState", "keyDown", "LEFT_ARROW", "UP_ARROW", "RIGHT_ARROW", "DOWN_ARROW", "zoom", "movement", "parseKeyDown", "keyMove", "touch1", "touch2", "dist", "boundRect", "imgData", "_isVisible", "_updatePropertiesFromImage", "initialZoom", "cssReset", "transformReset", "originReset", "isVisible", "_bindPoints", "_centerImage", "initial", "minZoom", "maxZoom", "defaultInitialZoom", "boundaryData", "minW", "minH", "points", "pointsWidth", "vpOffset", "originTop", "originLeft", "transformTop", "transformLeft", "imgDim", "vpDim", "boundDim", "vpLeft", "vpTop", "_transferImageToCanvas", "customOrientation", "_getCanvas", "right", "bottom", "circle", "startX", "startY", "canvasWidth", "canvasHeight", "sx", "sy", "sWidth", "sHeight", "dx", "dy", "dWidth", "dHeight", "_getHtmlResult", "div", "_getBase64Result", "_getBlobResult", "blob", "_replaceImage", "_bind", "options", "cb", "url", "hasExif", "natDim", "rect", "aspectRatio", "imgAspectRatio", "x0", "y0", "x1", "y1", "p", "decimalPoints", "_get", "widthDiff", "heightDiff", "x2", "y2", "max", "RESULT_DEFAULTS", "RESULT_FORMATS", "_result", "opts", "resultType", "size", "format", "backgroundColor", "ratio", "prom", "_refresh", "_rotate", "deg", "oldHeight", "oldWidth", "_destroy", "$", "ot", "singleInst", "method", "origImage", "replacementDiv", "bindOpts", "require_compressor", "__commonJSMin", "exports", "module", "global", "factory", "ownKeys", "object", "enumerableOnly", "keys", "symbols", "sym", "_objectSpread2", "target", "i", "source", "key", "_defineProperty", "_classCallCheck", "instance", "Constructor", "_defineProperties", "props", "descriptor", "_toPropertyKey", "_createClass", "protoProps", "staticProps", "obj", "value", "_extends", "_toPrimitive", "input", "hint", "prim", "res", "arg", "canvasToBlob", "window", "CanvasPrototype", "hasBlobConstructor", "hasArrayBufferViewSupport", "BlobBuilder", "dataURIPattern", "dataURLtoBlob", "dataURI", "matches", "mediaType", "isBase64", "dataString", "byteString", "arrayBuffer", "intArray", "bb", "callback", "type", "quality", "self", "toBlob", "isBlob", "DEFAULTS", "IS_BROWSER", "WINDOW", "isPositiveNumber", "slice", "toArray", "REGEXP_IMAGE_TYPE", "isImageType", "imageTypeToExtension", "extension", "fromCharCode", "getStringFromCharCode", "dataView", "start", "length", "str", "btoa", "arrayBufferToDataURL", "mimeType", "chunks", "chunkSize", "uint8", "resetAndGetOrientation", "orientation", "littleEndian", "app1Start", "ifdStart", "offset", "exifIDCode", "tiffOffset", "endianness", "firstIFDOffset", "_length", "_offset", "parseOrientation", "rotate", "scaleX", "scaleY", "REGEXP_DECIMALS", "normalizeDecimalNumber", "times", "getAdjustedSizes", "_ref", "aspectRatio", "height", "width", "isValidWidth", "isValidHeight", "adjustedWidth", "getExif", "array", "segments", "next", "end", "segment", "exifArray", "current", "insertExif", "app0Length", "newArrayBuffer", "ArrayBuffer$1", "FileReader", "URL", "REGEXP_EXTENSION", "AnotherCompressor", "Compressor", "file", "options", "_this", "isJPEGImage", "checkOrientation", "retainExif", "reader", "result", "data", "_this2", "image", "_ref2", "_this3", "naturalWidth", "naturalHeight", "_ref2$rotate", "_ref2$scaleX", "_ref2$scaleY", "canvas", "context", "is90DegreesRotated", "resizable", "maxWidth", "maxHeight", "minWidth", "minHeight", "_ref3", "_ref4", "_ref5", "_getAdjustedSizes", "_getAdjustedSizes2", "_getAdjustedSizes3", "_getAdjustedSizes4", "_getAdjustedSizes4$wi", "_getAdjustedSizes4$he", "destX", "destY", "destWidth", "destHeight", "params", "srcX", "srcY", "srcWidth", "srcHeight", "_getAdjustedSizes5", "_ref6", "fillStyle", "blob", "done", "_ref7", "_ref8", "date", "err", "require_classnames", "__commonJSMin", "exports", "module", "hasOwn", "classNames", "classes", "i", "arg", "appendClass", "parseValue", "key", "value", "newClass", "turbo_es2017_esm_exports", "__export", "FetchEnctype", "FetchMethod", "FetchRequest", "FetchResponse", "FrameElement", "FrameLoadingStyle", "FrameRenderer", "PageRenderer", "PageSnapshot", "StreamActions", "StreamElement", "StreamSourceElement", "cache", "clearCache", "config", "connectStreamSource", "disconnectStreamSource", "fetchWithTurboHeaders", "fetchEnctypeFromString", "fetchMethodFromString", "isSafe", "navigator$1", "registerAdapter", "renderStreamMessage", "session", "setConfirmMethod", "setFormMode", "setProgressBarDelay", "start", "visit", "prototype", "submitter", "validateSubmitter", "form", "raise", "errorConstructor", "message", "name", "submittersByForm", "findSubmitterFromClickTarget", "target", "element", "candidate", "clickCaptured", "event", "prototypeOfSubmitEvent", "_FrameElement", "value", "frameLoadingStyleFromString", "style", "drive", "activateScriptElement", "createdScriptElement", "cspNonce", "getCspNonce", "copyElementAttributes", "destinationElement", "sourceElement", "createDocumentFragment", "html", "template", "dispatch", "eventName", "cancelable", "detail", "cancelEvent", "nextRepaint", "nextEventLoopTick", "nextAnimationFrame", "resolve", "nextMicrotask", "parseHTMLDocument", "unindent", "strings", "values", "lines", "interpolate", "match", "indent", "line", "result", "string", "i", "uuid", "_", "getAttribute", "attributeName", "elements", "hasAttribute", "markAsBusy", "clearBusyState", "waitForLoad", "timeoutInMilliseconds", "onComplete", "getHistoryMethodForAction", "action", "isAction", "getVisitAction", "getMetaElement", "getMetaContent", "nonce", "content", "setMetaContent", "findClosestRecursively", "selector", "elementIsFocusable", "queryAutofocusableElement", "elementOrDocumentFragment", "around", "callback", "reader", "before", "after", "doesNotTargetIFrame", "findLinkFromClickTarget", "getLocationForLink", "link", "expandURL", "debounce", "fn", "delay", "timeoutId", "args", "Config", "#submitter", "forms", "locatable", "getAnchor", "url", "anchorMatch", "getAction$1", "getExtension", "getLastPathComponent", "isPrefixedBy", "baseURL", "prefix", "getPrefix", "locationIsVisitable", "location", "rootLocation", "getRequestURL", "anchor", "toCacheKey", "urlsAreEqual", "left", "right", "getPathComponents", "addTrailingSlash", "response", "LimitedSet", "maxSize", "oldestValue", "recentRequests", "nativeFetch", "options", "modifiedHeaders", "requestUID", "method", "encoding", "#resolveRequestPromise", "_value", "delegate", "requestBody", "enctype", "body", "buildResourceAndBody", "fetchBody", "fetchMethod", "fetchOptions", "#allowRequestToBeIntercepted", "error", "#willDelegateErrorHandling", "fetchResponse", "mimeType", "requestInterception", "resource", "searchParams", "entriesExcludingFiles", "mergeIntoURLSearchParams", "entries", "AppearanceObserver", "StreamMessage", "fragment", "importStreamElements", "streamElement", "inertScriptElement", "PREFETCH_DELAY", "PrefetchCache", "#prefetchTimeout", "#prefetched", "request", "ttl", "cacheTtl", "prefetchCache", "FormSubmissionState", "FormSubmission", "_FormSubmission", "formElement", "mustRedirect", "getMethod", "getAction", "getFormAction", "buildFormData", "getEnctype", "initialized", "requesting", "confirmationMessage", "stopping", "stopped", "token", "getCookieValue", "_request", "responseSucceededWithoutRedirect", "input", "formData", "cookieName", "cookie", "formElementAction", "formAction", "Snapshot", "queryPermanentElementsAll", "id", "getPermanentElementById", "snapshot", "permanentElementMap", "currentPermanentElement", "newPermanentElement", "node", "FormSubmitObserver", "eventTarget", "submissionDoesNotDismissDialog", "submissionDoesNotTargetIFrame", "View", "#resolveRenderPromise", "#resolveInterceptionPromise", "x", "y", "renderer", "isPreview", "shouldRender", "willRender", "shouldInvalidate", "renderInterception", "reason", "direction", "FrameView", "LinkInterceptor", "_event", "LinkClickObserver", "FormLinkClickObserver", "originalEvent", "type", "turboFrame", "turboAction", "turboConfirm", "Bardo", "bardo", "permanentElement", "placeholder", "createPlaceholderForPermanentElement", "clone", "Renderer", "#activeElement", "currentElement", "newElement", "currentSnapshot", "newSnapshot", "reject", "destinationRange", "frameElement", "sourceRange", "renderElement", "block", "readScrollLogicalPosition", "behavior", "readScrollBehavior", "activatedScriptElement", "defaultValue", "Idiomorph", "EMPTY_SET", "defaults", "noOp", "elt", "morph", "oldNode", "newContent", "parseContent", "normalizedContent", "normalizeContent", "ctx", "createMorphContext", "morphNormalizedContent", "normalizedNewContent", "oldHead", "newHead", "promises", "handleHeadElement", "morphChildren", "bestMatch", "findBestNodeMatch", "previousSibling", "nextSibling", "morphedNode", "morphOldNodeTo", "insertSiblings", "ignoreValueOfActiveElement", "possibleActiveElement", "isSoftMatch", "syncNodeFrom", "newParent", "oldParent", "nextNewChild", "insertionPoint", "newChild", "removeIdsFromConsideration", "isIdSetMatch", "idSetMatch", "findIdSetMatch", "removeNodesBetween", "softMatch", "findSoftMatch", "tempNode", "removeNode", "ignoreAttribute", "attr", "to", "updateType", "from", "fromAttributes", "toAttributes", "fromAttribute", "toAttribute", "syncInputValue", "syncBooleanAttribute", "ignoreUpdate", "fromValue", "toValue", "newHeadTag", "currentHead", "added", "removed", "preserved", "nodesToAppend", "headMergeStyle", "srcToNewHeadNodes", "newHeadChild", "currentHeadElt", "inNewContent", "isReAppended", "isPreserved", "newNode", "newElt", "promise", "_resolve", "removedElement", "mergeDefaults", "finalConfig", "createIdMap", "node1", "node2", "getIdIntersectionCount", "startInclusive", "endExclusive", "newChildPotentialIdCount", "potentialMatch", "otherMatchCount", "potentialSoftMatch", "siblingSoftMatchCount", "parser", "contentWithSvgsRemoved", "htmlElement", "dummyParent", "stack", "bestElement", "score", "newScore", "scoreElement", "isIdInConsideration", "idIsWithinNode", "targetNode", "idSet", "sourceSet", "matchCount", "populateIdMapForNode", "idMap", "nodeParent", "idElements", "current", "oldContent", "morphElements", "callbacks", "DefaultIdiomorphCallbacks", "#beforeNodeMorphed", "beforeNodeMorphed", "mutationType", "MorphingFrameRenderer", "ProgressBar", "_ProgressBar", "HeadSnapshot", "elementIsNoscript", "elementWithoutNonce", "outerHTML", "details", "elementType", "elementIsTracked", "matchedType", "tracked", "elementIsMetaElementWithName", "elementIsScript", "elementIsStylesheet", "tagName", "_PageSnapshot", "documentElement", "head", "headSnapshot", "clonedElement", "selectElements", "clonedSelectElements", "index", "source", "option", "clonedPasswordInput", "root", "ViewTransitioner", "#viewTransitionStarted", "#lastOperation", "useViewTransition", "render", "defaultOptions", "TimingMetric", "VisitState", "SystemStatusCode", "Direction", "Visit", "restorationIdentifier", "historyChanged", "referrer", "snapshotHTML", "visitCachedSnapshot", "updateHistory", "shouldCacheSnapshot", "acceptsStreamResponse", "actionForHistory", "statusCode", "isSuccessful", "responseHTML", "_response", "redirected", "_error", "scrollPosition", "metric", "BrowserAdapter", "_visit", "_formSubmission", "CacheObserver", "FrameRedirector", "_location", "#shouldRedirect", "frame", "#findFrameElement", "#shouldSubmit", "meta", "History", "state", "additionalData", "restorationData", "turbo", "restorationIndex", "LinkPrefetchObserver", "#prefetchedLink", "#enable", "#tryToPrefetchRequest", "#cancelRequestIfObsolete", "#tryToUsePrefetchedRequest", "#isPrefetchable", "fetchRequest", "#cacheTtl", "#cancelPrefetchRequest", "cached", "turboFrameTarget", "unfetchableLink", "linkToTheSamePage", "linkOptsOut", "nonSafeLink", "eventPrevented", "turboPrefetchParent", "turboMethod", "isUJS", "Navigator", "formSubmission", "visitOptions", "#getActionForFormSubmission", "currentAnchor", "isRestorationToTop", "oldURL", "newURL", "#getDefaultAction", "PageStage", "PageObserver", "readyState", "ScrollObserver", "position", "StreamMessageRenderer", "getPermanentElementMapForFragment", "withAutofocusFromFragment", "withPreservedFocus", "permanentElementsInDocument", "permanentElementInDocument", "elementInStream", "generatedID", "turboStreams", "elementWithAutofocus", "firstAutofocusableElementInStreams", "willAutofocusId", "elementToAutofocus", "activeElementBeforeRender", "activeElementAfterRender", "restoreFocusTo", "elementToFocus", "nodeListOfStreamElements", "StreamObserver", "#started", "fetchResponseFromEvent", "fetchResponseIsStream", "ErrorRenderer", "replaceableElement", "parentNode", "#setLanguage", "lang", "mergedHeadElements", "newStylesheetElements", "loadingElements", "newHeadElements", "elementList", "MorphingPageRenderer", "canRefreshFrame", "SnapshotCache", "size", "key", "PageView", "rendererClass", "cachedSnapshot", "Preloader", "snapshotCache", "#preloadAll", "Cache", "#setCacheControl", "Session", "#pageRefreshDebouncePeriod", "adapter", "requestId", "isUnsafe", "isStream", "frameTarget", "extendURLWithDeprecatedProperties", "defaultPrevented", "_snapshot", "_isPreview", "renderMethod", "ev", "newBody", "timing", "submitterIsNavigatable", "container", "withinFrame", "deprecatedLocationPropertyDescriptors", "confirmMethod", "mode", "Turbo", "TurboFrameMissingError", "FrameController", "_fetchResponse", "#currentFetchRequest", "#resolveVisitPromise", "#connected", "#hasBeenLoaded", "#ignoredAttributes", "#shouldMorphFrame", "#loadSourceURL", "#isIgnoringChangesTo", "refresh", "src", "#visit", "document", "#loadFrameResponse", "#handleUnvisitableFrameResponse", "#shouldInterceptNavigation", "#navigateFrame", "newFrame", "_renderMethod", "_newElement", "newFrameElement", "#willHandleFrameMissingFromResponse", "#handleFrameMissingFromResponse", "#withCurrentNavigationElement", "pageSnapshot", "#visitResponse", "#throwFrameMissingError", "wrapped", "getFrameElementById", "activateElement", "#formActionIsVisitable", "sourceURL", "#ignoringChangesToAttribute", "currentURL", "e", "targetElement", "_StreamElement", "c", "existingChildren", "newChildrenIds", "actionFunction", "#raise", "consumer", "getConsumer", "setConsumer", "createConsumer", "newConsumer", "subscribeTo", "channel", "mixin", "subscriptions", "walk", "obj", "acc", "key", "camel", "m", "x", "TurboCableStreamSourceElement", "connectStreamSource", "subscribeTo", "disconnectStreamSource", "data", "event", "channel", "signed_stream_name", "walk", "encodeMethodIntoRequestBody", "event", "form", "fetchOptions", "submitter", "body", "isBodyInit", "method", "determineFetchMethod", "formMethod", "determineFormMethod", "overrideMethod", "turbo_es2017_esm_exports", "encodeMethodIntoRequestBody", "sparkMd5", "module", "exports", "factory", "undefined$1", "hex_chr", "md5cycle", "x", "k", "a", "b", "c", "d", "md5blk", "s", "md5blks", "i", "md5blk_array", "md51", "n", "state", "length", "tail", "tmp", "lo", "hi", "md51_array", "rhex", "j", "hex", "clamp", "val", "from", "to", "begin", "end", "num", "target", "targetArray", "sourceArray", "toUtf8", "str", "utf8Str2ArrayBuffer", "returnUInt8Array", "buff", "arr", "arrayBuffer2Utf8Str", "concatenateArrayBuffers", "first", "second", "result", "hexToBinaryString", "bytes", "SparkMD5", "contents", "raw", "ret", "content", "hash", "fileSlice", "FileChecksum", "_FileChecksum", "file", "callback", "event", "binaryDigest", "base64digest", "start", "getMetaValue", "name", "element", "findElement", "findElements", "root", "selector", "elements", "toArray", "dispatchEvent", "type", "eventInit", "disabled", "bubbles", "cancelable", "detail", "value", "BlobRecord", "checksum", "url", "customHeaders", "headerKey", "csrfToken", "responseType", "response", "direct_upload", "key", "BlobUpload", "blob", "headers", "status", "id", "DirectUpload", "delegate", "error", "notify", "upload", "object", "methodName", "messages", "DirectUploadController", "input", "hiddenInput", "attributes", "progress", "xhr", "inputSelector", "DirectUploadsController", "form", "controllers", "startNextController", "controller", "processingAttribute", "submitButtonsByForm", "started", "didClick", "didSubmitForm", "didSubmitRemoteElement", "button", "handleFormSubmissionEvent", "inputs", "disable", "enable", "submitForm", "autostart", "EventListener", "eventTarget", "eventName", "eventOptions", "binding", "event", "extendedEvent", "extendEvent", "left", "right", "leftIndex", "rightIndex", "stopImmediatePropagation", "Dispatcher", "application", "eventListener", "listeners", "map", "clearEventListeners", "error", "message", "detail", "eventListenerMap", "cacheKey", "parts", "key", "defaultActionDescriptorFilters", "value", "element", "descriptorPattern", "parseActionDescriptorString", "descriptorString", "matches", "keyFilter", "parseEventTarget", "parseEventOptions", "eventTargetName", "options", "token", "stringifyEventTarget", "camelize", "_", "char", "namespaceCamelize", "capitalize", "dasherize", "tokenize", "isSomething", "object", "hasProperty", "property", "allModifiers", "Action", "index", "descriptor", "schema", "getDefaultEventNameForElement", "eventFilter", "filters", "standardFilter", "params", "pattern", "name", "match", "typecast", "meta", "ctrl", "alt", "shift", "modifier", "defaultEventNames", "e", "tagName", "Binding", "context", "action", "actionEvent", "method", "actionDescriptorFilters", "controller", "passes", "filter", "target", "currentTarget", "identifier", "ElementObserver", "delegate", "mutations", "callback", "mutation", "attributeName", "nodes", "node", "tree", "processor", "AttributeObserver", "add", "fetch", "del", "prune", "values", "Multimap", "set", "size", "_key", "_values", "SelectorObserver", "element", "selector", "delegate", "details", "ElementObserver", "Multimap", "callback", "matches", "tree", "match", "selectors", "_attributeName", "matchedBefore", "StringMapObserver", "mutations", "attributeName", "mutation", "oldValue", "key", "value", "attribute", "TokenListObserver", "AttributeObserver", "unmatchedTokens", "matchedTokens", "tokens", "token", "previousTokens", "currentTokens", "firstDifferingIndex", "zip", "previousToken", "currentToken", "tokensAreEqual", "tokenString", "parseTokenString", "content", "index", "left", "right", "length", "_", "ValueListObserver", "parseResult", "valuesByToken", "error", "BindingObserver", "context", "action", "binding", "Binding", "Action", "ValueObserver", "receiver", "descriptor", "name", "defaultValue", "writer", "rawValue", "rawOldValue", "changedMethodName", "changedMethod", "valueDescriptorMap", "descriptors", "hasMethodName", "capitalize", "TargetObserver", "_a", "readInheritableStaticArrayValues", "constructor", "propertyName", "ancestors", "getAncestorsForConstructor", "values", "getOwnStaticArrayValues", "readInheritableStaticObjectPairs", "pairs", "getOwnStaticObjectPairs", "definition", "OutletObserver", "outletName", "observer", "_selector", "outlet", "hasOutlet", "hasOutletController", "_element", "selectorObserver", "attributeObserver", "dependencies", "module", "identifiers", "Context", "scope", "functionName", "detail", "identifier", "controller", "message", "namespaceCamelize", "methodName", "args", "bless", "shadow", "getBlessedProperties", "properties", "shadowConstructor", "extend", "shadowProperties", "getShadowProperties", "blessedProperties", "blessing", "prototype", "getOwnKeys", "getShadowedDescriptor", "shadowingDescriptor", "object", "extendWithReflect", "extended", "testReflectExtension", "b", "blessDefinition", "Module", "application", "ClassMap", "tokenize", "DataMap", "dasherize", "Guide", "logger", "warnedKeys", "attributeValueContainsToken", "TargetSet", "targetName", "targetNames", "target", "targets", "targetDescriptor", "revisedAttributeName", "OutletSet", "controllerElement", "outletNames", "outlets", "controllerAttribute", "Scope", "_Scope", "schema", "ScopeObserver", "scopesByIdentifier", "referenceCount", "Router", "contexts", "afterLoad", "defaultSchema", "objectFromEntries", "c", "array", "memo", "k", "v", "Application", "Dispatcher", "defaultActionDescriptorFilters", "domReady", "controllerConstructor", "filter", "head", "rest", "resolve", "ClassPropertiesBlessing", "classDefinition", "propertiesForClassDefinition", "classes", "OutletPropertiesBlessing", "outletDefinition", "propertiesForOutletDefinition", "getOutletController", "getControllerAndEnsureConnectedScope", "outletController", "camelizedName", "outletElement", "TargetPropertiesBlessing", "targetDefinition", "propertiesForTargetDefinition", "ValuePropertiesBlessing", "valueDefinitionPairs", "propertyDescriptorMap", "result", "valueDefinitionPair", "valueDescriptor", "parseValueDefinitionPair", "propertiesForValueDefinitionPair", "read", "write", "typeDefinition", "valueDescriptorForTokenAndTypeDefinition", "parseValueTypeConstant", "constant", "parseValueTypeDefault", "parseValueTypeObject", "payload", "typeObject", "hasType", "isSomething", "hasDefault", "fullObject", "onlyType", "onlyDefault", "typeFromObject", "typeFromDefaultValue", "propertyPath", "parseValueTypeDefinition", "typeFromConstant", "type", "defaultValueForDefinition", "defaultValuesByType", "hasProperty", "constantFromType", "camelize", "readers", "writers", "writeString", "writeJSON", "Controller", "_identifier", "_application", "eventName", "prefix", "bubbles", "cancelable", "event", "application", "Application", "enter", "element", "transitionName", "transition", "leave", "transition", "direction", "element", "animation", "dataset", "animationClass", "genesis", "start", "end", "addClasses", "nextFrame", "removeClasses", "afterTransition", "classes", "resolve", "computedDuration", "duration", "app_controller_default", "Controller", "enter", "leave", "event", "award_form_controller_default", "Controller", "target", "noop", "uid", "id", "isNullOrUndef", "value", "isArray", "type", "isObject", "isNumberFinite", "finiteOrDefault", "defaultValue", "valueOrDefault", "toPercentage", "dimension", "toDimension", "callback", "fn", "args", "thisArg", "each", "loopable", "reverse", "i", "len", "keys", "_elementsEqual", "a0", "a1", "ilen", "v0", "v1", "clone$1", "source", "target", "klen", "k", "isValidKey", "key", "_merger", "options", "tval", "sval", "merge", "sources", "merger", "mergeIf", "_mergerIf", "keyResolvers", "v", "o", "resolveObjectKey", "obj", "key", "_getKeyResolver", "keys", "_splitKey", "k", "parts", "tmp", "part", "_capitalize", "str", "defined", "value", "isFunction", "setsEqual", "a", "b", "item", "_isClickEvent", "e", "PI", "TAU", "PITAU", "INFINITY", "RAD_PER_DEG", "HALF_PI", "QUARTER_PI", "TWO_THIRDS_PI", "log10", "sign", "niceNum", "range", "roundedRange", "almostEquals", "niceRange", "fraction", "_factorize", "result", "sqrt", "isNumber", "x", "y", "epsilon", "almostWhole", "rounded", "_setMinAndMaxByKey", "array", "target", "property", "ilen", "toRadians", "degrees", "toDegrees", "radians", "_decimalPlaces", "isNumberFinite", "p", "getAngleFromPoint", "centrePoint", "anglePoint", "distanceFromXCenter", "distanceFromYCenter", "radialDistanceFromCenter", "angle", "distanceBetweenPoints", "pt1", "pt2", "_angleDiff", "_normalizeAngle", "_angleBetween", "start", "end", "sameAngleIsFullCircle", "s", "angleToStart", "angleToEnd", "startToAngle", "endToAngle", "_limitValue", "min", "max", "_int16Range", "_isBetween", "_lookup", "table", "cmp", "index", "hi", "lo", "mid", "_lookupByKey", "last", "_rlookupByKey", "_filterBetween", "values", "arrayEvents", "listenArrayEvents", "listener", "method", "base", "args", "res", "object", "unlistenArrayEvents", "stub", "listeners", "_arrayUnique", "items", "set", "i", "requestAnimFrame", "callback", "throttled", "fn", "thisArg", "updateFn", "updateArgs", "args", "ticking", "rest", "debounce", "delay", "timeout", "_toLeftRightCenter", "align", "_alignStartEnd", "start", "end", "_textX", "left", "right", "rtl", "_getStartAndCountOfVisiblePoints", "meta", "points", "animationsDisabled", "pointCount", "count", "iScale", "_parsed", "axis", "min", "max", "minDefined", "maxDefined", "_limitValue", "_lookupByKey", "_scaleRangesChanged", "xScale", "yScale", "_scaleRanges", "newRanges", "changed", "atEdge", "t", "elasticIn", "s", "p", "TAU", "elasticOut", "effects", "HALF_PI", "PI", "round", "v", "lim", "l", "h", "p2b", "n2b", "b2n", "n2p", "map$1", "hex", "h1", "b", "h2", "eq", "isShort", "hexParse", "str", "len", "ret", "alpha", "a", "f", "hexString", "HUE_RE", "hsl2rgbn", "n", "k", "hsv2rgbn", "hwb2rgbn", "w", "rgb", "i", "hueValue", "r", "g", "d", "rgb2hsl", "calln", "c", "hsl2rgb", "hwb2rgb", "hsv2rgb", "hue", "hueParse", "m", "p1", "p2", "rotate", "deg", "hslString", "map", "names$1", "unpack", "unpacked", "keys", "tkeys", "j", "ok", "nk", "names", "nameParse", "RGB_RE", "rgbParse", "rgbString", "to", "from", "interpolate", "rgb1", "rgb2", "modHSL", "ratio", "tmp", "clone", "proto", "fromObject", "input", "functionParse", "Color", "_Color", "type", "obj", "color", "weight", "c1", "c2", "w2", "w1", "val", "index_esm", "isPatternOrGradient", "value", "getHoverColor", "overrides", "descriptors", "getScope$1", "node", "key", "set", "root", "scope", "values", "merge", "Defaults", "_descriptors", "context", "ctx", "options", "name", "targetScope", "targetName", "scopeObject", "targetScopeObject", "privateName", "local", "target", "isObject", "valueOrDefault", "defaults", "toFontString", "font", "isNullOrUndef", "_measureText", "data", "gc", "longest", "string", "textWidth", "_longestText", "arrayOfThings", "cache", "ilen", "jlen", "thing", "nestedThing", "isArray", "gcLen", "_alignPixel", "chart", "pixel", "width", "devicePixelRatio", "halfWidth", "clearCanvas", "canvas", "drawPoint", "x", "y", "drawPointLegend", "xOffset", "yOffset", "size", "cornerRadius", "style", "rotation", "radius", "rad", "RAD_PER_DEG", "TWO_THIRDS_PI", "QUARTER_PI", "_isPointInArea", "point", "area", "margin", "clipArea", "unclipArea", "_steppedLineTo", "previous", "flip", "mode", "midpoint", "_bezierCurveTo", "renderText", "text", "opts", "lines", "stroke", "line", "setRenderOpts", "decorateText", "metrics", "top", "bottom", "yDecoration", "addRoundedRectPath", "rect", "LINE_HEIGHT", "FONT_STYLE", "toLineHeight", "matches", "numberOrZero", "_readValueToProps", "props", "objProps", "read", "prop", "toTRBL", "toTRBLCorners", "toPadding", "toFont", "fallback", "resolve", "inputs", "index", "info", "cacheable", "_addGrace", "minmax", "grace", "beginAtZero", "change", "toDimension", "keepZero", "add", "createContext", "parentContext", "_createResolver", "scopes", "prefixes", "rootScopes", "getTarget", "defined", "_resolve", "_cached", "_resolveWithPrefixes", "getKeysFromAllScopes", "storage", "_attachContext", "proxy", "subProxy", "descriptorDefaults", "receiver", "_resolveWithContext", "_scriptable", "_indexable", "_allKeys", "isFunction", "readKey", "prefix", "_capitalize", "needsSubResolver", "_proxy", "_context", "_subProxy", "_resolveScriptable", "_resolveArray", "_stack", "createSubResolver", "isIndexable", "arr", "item", "resolver", "resolveFallback", "getScope", "parent", "resolveObjectKey", "addScopes", "parentScopes", "parentFallback", "allScopes", "addScopesFromKey", "subGetTarget", "resolveKeysFromAllScopes", "_parseObjectDataRadialScale", "parsed", "EPSILON", "getPoint", "getValueAxis", "indexAxis", "splineCurve", "firstPoint", "middlePoint", "afterPoint", "current", "next", "d01", "distanceBetweenPoints", "d12", "s01", "s12", "fa", "fb", "monotoneAdjust", "deltaK", "mK", "pointsLen", "alphaK", "betaK", "tauK", "squaredMagnitude", "pointCurrent", "pointAfter", "almostEquals", "monotoneCompute", "valueAxis", "delta", "pointBefore", "iPixel", "vPixel", "splineCurveMonotone", "slopeDelta", "sign", "capControlPoint", "pt", "capBezierPoints", "inArea", "inAreaPrev", "inAreaNext", "_updateBezierControlPoints", "loop", "controlPoints", "prev", "_isDomSupported", "_getParentNode", "domNode", "parseMaxStyle", "styleValue", "parentProperty", "valueInPixels", "getComputedStyle", "element", "getStyle", "el", "property", "positions", "getPositionedStyle", "styles", "suffix", "result", "pos", "useOffsetPos", "getCanvasPosition", "e", "touches", "source", "offsetX", "offsetY", "box", "getRelativePosition", "evt", "currentDevicePixelRatio", "borderBox", "paddings", "borders", "height", "getContainerSize", "maxWidth", "maxHeight", "container", "containerStyle", "containerBorder", "containerPadding", "INFINITY", "round1", "getMaximumSize", "bbWidth", "bbHeight", "aspectRatio", "margins", "containerSize", "retinaScale", "forceRatio", "forceStyle", "pixelRatio", "deviceHeight", "deviceWidth", "supportsEventListenerOptions", "passiveSupported", "readUsedSize", "_pointInLine", "_steppedInterpolation", "_bezierInterpolation", "cp1", "cp2", "intlCache", "getNumberFormat", "locale", "cacheKey", "formatter", "formatNumber", "num", "getRightToLeftAdapter", "rectX", "itemWidth", "getLeftToRightAdapter", "_itemWidth", "getRtlAdapter", "overrideTextDirection", "direction", "original", "restoreTextDirection", "propertyFn", "_angleBetween", "_angleDiff", "_normalizeAngle", "_isBetween", "normalizeSegment", "getSegment", "segment", "bounds", "startBound", "endBound", "between", "normalize", "_boundSegment", "compare", "inside", "subStart", "prevValue", "startIsBefore", "endIsBefore", "shouldStart", "shouldStop", "_boundSegments", "segments", "sub", "findStartAndEnd", "spanGaps", "solidSegments", "last", "cur", "_computeSegments", "segmentOptions", "splitByStyles", "completeLoop", "doSplitByStyles", "chartContext", "baseStyle", "readStyle", "datasetIndex", "prevStyle", "addStyle", "st", "dir", "styleChanged", "Animator", "chart", "anims", "date", "type", "callbacks", "numSteps", "fn", "requestAnimFrame", "remaining", "items", "i", "draw", "item", "charts", "event", "cb", "acc", "cur", "animator", "transparent", "interpolators", "from", "to", "factor", "c0", "color", "c1", "Animation", "cfg", "target", "prop", "currentValue", "resolve", "effects", "elapsed", "remain", "duration", "loop", "promises", "res", "rej", "resolved", "method", "numbers", "colors", "defaults", "animationOptions", "name", "v", "Animations", "config", "isObject", "animatedProps", "key", "option", "isArray", "values", "newOptions", "options", "resolveTargetOptions", "animations", "awaitAll", "running", "props", "value", "animation", "properties", "keys", "anim", "scaleClip", "scale", "allowedOverflow", "opts", "reverse", "min", "max", "defaultClip", "xScale", "yScale", "x", "y", "toClip", "t", "r", "b", "l", "getSortedDatasetIndices", "filterVisible", "metasets", "ilen", "applyStack", "stack", "dsIndex", "singleMode", "datasetIndex", "otherValue", "isNumberFinite", "sign", "convertObjectDataToArray", "data", "adata", "isStacked", "meta", "stacked", "getStackKey", "indexScale", "valueScale", "getUserBounds", "minDefined", "maxDefined", "getOrCreateStack", "stacks", "stackKey", "indexValue", "subStack", "getLastIndexInStack", "vScale", "positive", "updateStacks", "controller", "parsed", "iScale", "iAxis", "vAxis", "index", "itemStacks", "getFirstScaleId", "axis", "scales", "createDatasetContext", "parent", "createContext", "createDataContext", "element", "clearStacks", "isDirectUpdateMode", "mode", "cloneIfNotShared", "cached", "shared", "createStack", "canStack", "DatasetController", "dataset", "chooseId", "xid", "valueOrDefault", "yid", "rid", "indexAxis", "iid", "vid", "scaleID", "unlistenArrayEvents", "_data", "listenArrayEvents", "resetNewElements", "stackChanged", "oldStacked", "scopeKeys", "scopes", "start", "count", "_stacked", "sorted", "prev", "isNotInOrderComparedToPrev", "labels", "singleScale", "xAxisKey", "yAxisKey", "resolveObjectKey", "range", "parsedValue", "_parsed", "otherScale", "otherMin", "otherMax", "_skip", "ctx", "elements", "area", "active", "drawActiveElementsOnTop", "context", "elementType", "cache", "cacheKey", "sharing", "defined", "prefixes", "names", "transition", "sharedOptions", "firstOpts", "previouslySharedOptions", "includeOptions", "arg1", "arg2", "numMeta", "numData", "end", "move", "arr", "removed", "args", "newCount", "getAllScaleValues", "visibleMetas", "_arrayUnique", "a", "computeMinSampleSize", "curr", "updateMinAndPrev", "computeFitCategoryTraits", "ruler", "stackCount", "thickness", "size", "ratio", "isNullOrUndef", "computeFlexCategoryTraits", "pixels", "next", "percent", "parseFloatBar", "entry", "startValue", "endValue", "barStart", "barEnd", "parseValue", "parseArrayOrPrimitive", "isFloatBar", "custom", "barSign", "actualBase", "borderProps", "top", "bottom", "setBorderSkipped", "edge", "parseEdge", "swap", "startEnd", "orig", "v1", "v2", "setInflateAmount", "inflateAmount", "BarController", "iAxisKey", "vAxisKey", "obj", "bars", "reset", "base", "horizontal", "vpixels", "ipixels", "last", "dataIndex", "skipNull", "val", "barThickness", "baseValue", "minBarLength", "floating", "length", "head", "startPixel", "endPixel", "halfGrid", "maxBarThickness", "center", "stackIndex", "rects", "BubbleController", "points", "point", "iPixel", "vPixel", "radius", "getRatioAndOffset", "rotation", "circumference", "cutout", "ratioX", "ratioY", "offsetX", "offsetY", "TAU", "startAngle", "endAngle", "startX", "startY", "endX", "endY", "calcMax", "angle", "_angleBetween", "calcMin", "maxX", "maxY", "HALF_PI", "minX", "PI", "minY", "DoughnutController", "getter", "toRadians", "chartArea", "arcs", "spacing", "maxSize", "toPercentage", "chartWeight", "maxWidth", "maxHeight", "maxRadius", "outerRadius", "toDimension", "innerRadius", "radiusLength", "animationOpts", "centerX", "centerY", "animateScale", "arc", "metaData", "total", "formatNumber", "ringWeightOffset", "pointStyle", "label", "style", "e", "legendItem", "legend", "tooltipItem", "dataLabel", "LineController", "line", "_dataset", "animationsDisabled", "_getStartAndCountOfVisiblePoints", "_scaleRangesChanged", "spanGaps", "segment", "maxGapLength", "isNumber", "directUpdate", "prevParsed", "nullData", "border", "firstPoint", "lastPoint", "PolarAreaController", "_parseObjectDataRadialScale", "minSize", "datasetStartAngle", "defaultAngle", "PieController", "RadarController", "pointPosition", "Element", "useFinalPosition", "final", "ret", "formatters", "tickValue", "ticks", "locale", "notation", "delta", "maxTick", "calculateDelta", "logDelta", "log10", "numDecimal", "Ticks", "_ctx", "autoSkip", "tickOpts", "ticksLimit", "determineMaxTicks", "majorIndices", "getMajorIndices", "numMajorIndices", "first", "newTicks", "skipMajors", "calculateSpacing", "avgMajorSpacing", "skip", "offset", "tickLength", "maxScale", "maxChart", "evenMajorSpacing", "getEvenSpacing", "factors", "_factorize", "result", "majorStart", "majorEnd", "len", "diff", "reverseAlign", "align", "offsetFromEdge", "sample", "numItems", "increment", "getPixelForGridLine", "offsetGridLines", "validIndex", "epsilon", "lineValue", "garbageCollect", "caches", "each", "gc", "gcLen", "getTickMarkLength", "getTitleHeight", "fallback", "font", "toFont", "padding", "toPadding", "createScaleContext", "createTickContext", "tick", "titleAlign", "position", "_toLeftRightCenter", "titleArgs", "left", "right", "titleX", "titleY", "height", "width", "_alignStartEnd", "positionAxisID", "Scale", "_Scale", "raw", "_userMin", "_userMax", "_suggestedMin", "_suggestedMax", "finiteOrDefault", "metas", "callback", "margins", "beginAtZero", "grace", "sampleSize", "_addGrace", "samplingEnabled", "reversePixels", "numTicks", "minRotation", "maxRotation", "labelRotation", "tickWidth", "maxLabelDiagonal", "labelSizes", "maxLabelWidth", "maxLabelHeight", "_limitValue", "toDegrees", "titleOpts", "gridOpts", "display", "isHorizontal", "titleHeight", "widest", "highest", "tickPadding", "angleRadians", "cos", "sin", "labelHeight", "labelWidth", "isRotated", "labelsBelowTicks", "offsetLeft", "offsetRight", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "widths", "heights", "widestLabelSize", "highestLabelSize", "j", "jlen", "tickFont", "fontString", "lineHeight", "nestedLabel", "_measureText", "valueAt", "idx", "pixel", "decimal", "_int16Range", "_alignPixel", "optionTicks", "rot", "w", "h", "grid", "ticksLength", "tl", "borderOpts", "axisWidth", "axisHalfWidth", "alignBorderValue", "borderValue", "alignedLineValue", "tx1", "ty1", "tx2", "ty2", "x1", "y1", "x2", "y2", "limit", "step", "optsAtIndex", "lineWidth", "lineColor", "borderDash", "borderDashOffset", "tickColor", "tickBorderDash", "tickBorderDashOffset", "crossAlign", "mirror", "tickAndPadding", "hTickAndPadding", "textAlign", "lineCount", "textOffset", "textBaseline", "halfCount", "strokeColor", "strokeWidth", "tickTextAlign", "backdrop", "labelPadding", "backgroundColor", "drawLine", "p1", "p2", "lastLineWidth", "clipArea", "renderText", "unclipArea", "title", "tz", "gz", "axisID", "fontSize", "TypedRegistry", "scope", "override", "proto", "parentScope", "isIChartComponent", "id", "registerDefaults", "overrides", "itemDefaults", "merge", "routeDefaults", "routes", "property", "propertyParts", "sourceName", "sourceScope", "parts", "targetName", "targetScope", "Registry", "typedRegistry", "arg", "reg", "itemReg", "registry", "component", "camelMethod", "_capitalize", "ScatterController", "showLine", "abstract", "DateAdapter", "options", "chartOptions", "value", "format", "timestamp", "amount", "unit", "a", "b", "weekday", "members", "adapters", "binarySearch", "metaset", "axis", "intersect", "controller", "data", "_sorted", "iScale", "lookupMethod", "_rlookupByKey", "_lookupByKey", "el", "range", "start", "end", "evaluateInteractionItems", "chart", "position", "handler", "metasets", "i", "ilen", "index", "lo", "hi", "j", "element", "getDistanceMetricForAxis", "useX", "useY", "pt1", "pt2", "deltaX", "deltaY", "getIntersectItems", "useFinalPosition", "includeInvisible", "items", "datasetIndex", "_isPointInArea", "getNearestRadialItems", "evaluationFunc", "startAngle", "endAngle", "angle", "getAngleFromPoint", "_angleBetween", "getNearestCartesianItems", "distanceMetric", "minDistance", "inRange", "center", "distance", "getNearestItems", "getAxisItems", "rangeMethod", "intersectsItem", "Interaction", "getRelativePosition", "elements", "meta", "STATIC_POSITIONS", "filterByPosition", "array", "v", "filterDynamicPositionByAxis", "sortByWeight", "reverse", "v0", "v1", "wrapBoxes", "boxes", "layoutBoxes", "box", "pos", "stack", "stackWeight", "buildStacks", "layouts", "stacks", "wrap", "_stack", "setLayoutDims", "params", "vBoxMaxWidth", "hBoxMaxHeight", "layout", "fullSize", "factor", "buildLayoutBoxes", "left", "right", "top", "bottom", "centerHorizontal", "centerVertical", "getCombinedMax", "maxPadding", "chartArea", "updateMaxPadding", "boxPadding", "updateDims", "isObject", "newWidth", "newHeight", "widthChanged", "heightChanged", "handleMaxPadding", "updatePos", "change", "getMargins", "horizontal", "marginForPositions", "positions", "margin", "fitBoxes", "refitBoxes", "refit", "changed", "same", "other", "setBoxDims", "width", "height", "placeBoxes", "userPadding", "x", "y", "weight", "defined", "defaults", "item", "layoutItem", "minPadding", "padding", "toPadding", "availableWidth", "availableHeight", "verticalBoxes", "horizontalBoxes", "each", "visibleVerticalBoxCount", "total", "BasePlatform", "canvas", "aspectRatio", "context", "type", "listener", "config", "BasicPlatform", "EXPANDO_KEY", "EVENT_TYPES", "isNullOrEmpty", "initCanvas", "style", "renderHeight", "renderWidth", "displayWidth", "readUsedSize", "displayHeight", "eventListenerOptions", "supportsEventListenerOptions", "addListener", "node", "removeListener", "fromNativeEvent", "event", "nodeListContains", "nodeList", "createAttachObserver", "observer", "entries", "trigger", "entry", "createDetachObserver", "drpListeningCharts", "oldDevicePixelRatio", "onWindowResize", "dpr", "resize", "listenDevicePixelRatioChanges", "unlistenDevicePixelRatioChanges", "createResizeObserver", "container", "_getParentNode", "throttled", "w", "releaseObserver", "createProxyAndListen", "proxy", "args", "DomPlatform", "initial", "prop", "isNullOrUndef", "key", "proxies", "getMaximumSize", "_detectPlatform", "_isDomSupported", "PluginService", "hook", "filter", "descriptors", "result", "descriptor", "plugin", "method", "callback", "all", "valueOrDefault", "plugins", "allPlugins", "createDescriptors", "previousDescriptors", "diff", "localIds", "keys", "registry", "local", "getOpts", "id", "opts", "pluginOpts", "scopes", "getIndexAxis", "datasetDefaults", "getAxisFromDefaultScaleID", "indexAxis", "getDefaultScaleIDFromAxis", "axisFromPosition", "determineAxis", "scaleOptions", "mergeScaleConfig", "chartDefaults", "overrides", "configScales", "chartIndexAxis", "firstIDs", "scales", "scaleConf", "defaultId", "defaultScaleOptions", "mergeIf", "dataset", "defaultID", "scale", "initOptions", "initData", "initConfig", "keyCache", "keysCached", "cachedKeys", "cacheKey", "generate", "addIfFound", "set", "obj", "resolveObjectKey", "Config", "datasetType", "transition", "elementType", "mainScope", "resetCache", "_scopeCache", "cache", "keyLists", "cached", "names", "prefixes", "resolver", "subPrefixes", "getResolver", "needContext", "isFunction", "subResolver", "_attachContext", "descriptorDefaults", "resolverCache", "_createResolver", "p", "hasFunction", "acc", "isScriptable", "isIndexable", "_descriptors", "scriptable", "indexable", "isArray", "version", "KNOWN_POSITIONS", "positionIsHorizontal", "compare2Level", "l1", "l2", "onAnimationsComplete", "animationOptions", "onAnimationProgress", "getCanvas", "instances", "getChart", "c", "moveNumericKeys", "move", "intKey", "determineLastEvent", "e", "lastEvent", "inChartArea", "isClick", "Chart", "userConfig", "initialCanvas", "existingChart", "uid", "debounce", "mode", "animator", "maintainAspectRatio", "_aspectRatio", "retinaScale", "clearCanvas", "newSize", "newRatio", "scalesOptions", "axisOptions", "axisID", "scaleOpts", "updated", "isRadial", "isHorizontal", "scaleType", "scaleClass", "hasUpdated", "numData", "numMeta", "datasets", "newControllers", "ControllerClass", "datasetElementType", "dataElementType", "animsDisabled", "reset", "_active", "_lastEvent", "existingEvents", "newEvents", "setsEqual", "_hiddenIndices", "changes", "count", "_dataChanges", "datasetCount", "makeSet", "idx", "changeSet", "area", "noArea", "layers", "filterVisible", "ctx", "clip", "useClip", "clipArea", "unclipArea", "point", "createContext", "visible", "dataIndex", "anims", "listeners", "platform", "_add", "_remove", "detached", "attached", "enabled", "prefix", "activeElements", "lastActive", "active", "_elementsEqual", "replay", "hoverOptions", "deactivated", "activated", "eventFilter", "_isClickEvent", "invalidatePlugins", "enumerable", "clipArc", "pixelMargin", "outerRadius", "innerRadius", "angleMargin", "HALF_PI", "toRadiusCorners", "_readValueToProps", "parseBorderRadius$1", "arc", "angleDelta", "o", "halfThickness", "innerLimit", "computeOuterLimit", "val", "outerArcLimit", "_limitValue", "rThetaToXY", "r", "theta", "pathArc", "offset", "spacing", "circular", "innerR", "spacingOffset", "alpha", "noSpacingInnerRadius", "noSpacingOuterRadius", "avNogSpacingRadius", "adjustedAngle", "beta", "PI", "angleOffset", "outerStart", "outerEnd", "innerStart", "innerEnd", "outerStartAdjustedRadius", "outerEndAdjustedRadius", "outerStartAdjustedAngle", "outerEndAdjustedAngle", "innerStartAdjustedRadius", "innerEndAdjustedRadius", "innerStartAdjustedAngle", "innerEndAdjustedAngle", "pCenter", "p4", "p8", "outerStartX", "outerStartY", "outerEndX", "outerEndY", "drawArc", "fullCircles", "circumference", "TAU", "drawFullCircleBorders", "inner", "drawBorder", "borderWidth", "borderJoinStyle", "ArcElement", "Element", "cfg", "chartX", "chartY", "rAdjust", "betweenAngles", "withinRadius", "_isBetween", "halfAngle", "halfRadius", "radiusOffset", "setStyle", "lineTo", "previous", "target", "getLineMethod", "_steppedLineTo", "_bezierCurveTo", "pathVars", "points", "segment", "paramsStart", "paramsEnd", "segmentStart", "segmentEnd", "outside", "pathSegment", "line", "loop", "lineMethod", "prev", "fastPathSegment", "avgX", "countX", "prevX", "minY", "maxY", "lastY", "pointIndex", "drawX", "truncX", "_getSegmentMethod", "borderDash", "_getInterpolationMethod", "_steppedInterpolation", "_bezierInterpolation", "_pointInLine", "strokePathWithCache", "path", "strokePathDirect", "segments", "segmentMethod", "usePath2D", "draw", "LineElement", "_updateBezierControlPoints", "_computeSegments", "property", "_boundSegments", "_interpolate", "p1", "p2", "t", "interpolated", "name", "inRange$1", "PointElement", "mouseX", "mouseY", "radius", "drawPoint", "getBarBounds", "bar", "base", "half", "skipOrLimit", "skip", "min", "max", "parseBorderWidth", "maxW", "maxH", "toTRBL", "parseBorderRadius", "enableBorderRadius", "toTRBLCorners", "maxR", "enableBorder", "boundingRects", "bounds", "border", "skipX", "skipY", "hasRadius", "addNormalRectPath", "rect", "inflateRect", "refRect", "h", "BarElement", "inflateAmount", "borderColor", "backgroundColor", "outer", "addRectPath", "addRoundedRectPath", "getBoxSize", "labelOpts", "fontSize", "boxHeight", "boxWidth", "itemsEqual", "a", "b", "Legend", "Element", "config", "maxWidth", "maxHeight", "margins", "legendItems", "callback", "item", "options", "ctx", "labelFont", "toFont", "titleHeight", "itemHeight", "width", "height", "padding", "hitboxes", "lineWidths", "lineHeight", "totalHeight", "row", "top", "legendItem", "i", "itemWidth", "columnSizes", "heightLimit", "totalWidth", "currentColWidth", "currentColHeight", "left", "col", "align", "rtl", "rtlHelper", "getRtlAdapter", "_alignStartEnd", "hitbox", "clipArea", "unclipArea", "opts", "defaultColor", "defaults", "fontColor", "halfFontSize", "cursor", "drawLegendBox", "x", "y", "lineWidth", "valueOrDefault", "drawOptions", "centerX", "centerY", "drawPointLegend", "yBoxTop", "xBoxLeft", "borderRadius", "toTRBLCorners", "v", "addRoundedRectPath", "fillText", "renderText", "isHorizontal", "overrideTextDirection", "textWidth", "textAlign", "realX", "_textX", "restoreTextDirection", "titleOpts", "titleFont", "titlePadding", "toPadding", "position", "topPaddingPlusHalfFontSize", "acc", "size", "_toLeftRightCenter", "hitBox", "lh", "_isBetween", "isListened", "hoveredItem", "previous", "sameItem", "type", "plugin_legend", "chart", "_args", "legend", "layouts", "args", "e", "index", "ci", "datasets", "usePointStyle", "pointStyle", "color", "meta", "style", "borderWidth", "name", "positioners", "items", "i", "len", "x", "y", "count", "el", "pos", "eventPosition", "minDistance", "nearestElement", "center", "distanceBetweenPoints", "tp", "pushOrConcat", "base", "toPush", "isArray", "splitNewlines", "str", "createTooltipItem", "chart", "item", "element", "datasetIndex", "index", "controller", "label", "value", "getTooltipSize", "tooltip", "options", "ctx", "body", "footer", "title", "boxWidth", "boxHeight", "bodyFont", "toFont", "titleFont", "footerFont", "titleLineCount", "footerLineCount", "bodyLineItemCount", "padding", "toPadding", "height", "width", "combinedBodyLength", "bodyItem", "bodyLineHeight", "widthPadding", "maxLineWidth", "line", "each", "determineYAlign", "size", "doesNotFitWithAlign", "xAlign", "caret", "determineXAlign", "yAlign", "chartWidth", "left", "right", "determineAlignment", "alignX", "alignY", "paddingAndSize", "getBackgroundPoint", "alignment", "caretSize", "caretPadding", "cornerRadius", "topLeft", "topRight", "bottomLeft", "bottomRight", "toTRBLCorners", "_limitValue", "getAlignedX", "align", "getBeforeAfterBodyLines", "callback", "createTooltipContext", "parent", "tooltipItems", "createContext", "overrideCallbacks", "callbacks", "context", "override", "Tooltip", "Element", "config", "cached", "opts", "animations", "Animations", "beforeTitle", "afterTitle", "lines", "bodyItems", "scoped", "beforeFooter", "afterFooter", "active", "data", "labelColors", "labelPointStyles", "labelTextColors", "array", "a", "b", "changed", "replay", "properties", "position", "positionAndSize", "backgroundPoint", "tooltipPoint", "caretPosition", "ptX", "ptY", "x1", "x2", "x3", "y1", "y2", "y3", "pt", "length", "titleSpacing", "rtlHelper", "getRtlAdapter", "labelPointStyle", "boxPadding", "colorX", "rtlColorX", "yOffSet", "colorY", "drawOptions", "centerX", "centerY", "drawPoint", "isObject", "outerX", "innerX", "borderRadius", "v", "addRoundedRectPath", "bodySpacing", "bodyAlign", "displayColors", "xLinePadding", "fillLineOfText", "bodyAlignForCalculation", "textColor", "j", "ilen", "jlen", "tooltipSize", "anims", "animX", "animY", "point", "opacity", "hasTooltipContent", "overrideTextDirection", "restoreTextDirection", "activeElements", "lastActive", "meta", "_elementsEqual", "positionChanged", "inChartArea", "e", "caretX", "caretY", "plugin_tooltip", "_args", "args", "useFinalPosition", "noop", "labels", "labelCount", "tooltipItem", "isNullOrUndef", "name", "addIfString", "labels", "raw", "index", "addedLabels", "findOrAddLabel", "first", "last", "validIndex", "max", "_limitValue", "CategoryScale", "Scale", "cfg", "scaleOptions", "added", "label", "isNullOrUndef", "valueOrDefault", "minDefined", "maxDefined", "min", "offset", "ticks", "value", "pixel", "generateTicks$1", "generationOptions", "dataRange", "bounds", "step", "precision", "count", "maxTicks", "maxDigits", "includeBounds", "unit", "maxSpaces", "rmin", "rmax", "countDefined", "minSpacing", "spacing", "niceNum", "factor", "niceMin", "niceMax", "numSpaces", "almostWhole", "almostEquals", "decimalPlaces", "_decimalPlaces", "j", "relativeLabelSize", "horizontal", "minRotation", "rad", "toRadians", "ratio", "length", "LinearScaleBase", "beginAtZero", "setMin", "v", "setMax", "minSign", "sign", "maxSign", "tickOpts", "maxTicksLimit", "stepSize", "opts", "numericGeneratorOptions", "_setMinAndMaxByKey", "start", "end", "formatNumber", "LinearScale", "isNumberFinite", "tickFont", "Ticks", "isMajor", "tickVal", "log10", "generateTicks", "endExp", "endSignificand", "finiteOrDefault", "exp", "significand", "lastTick", "LogarithmicScale", "m", "decimal", "getTickBackdropHeight", "padding", "toPadding", "defaults", "measureLabelSize", "ctx", "font", "isArray", "_longestText", "determineLimits", "angle", "pos", "size", "fitWithPointLabels", "scale", "orig", "limits", "labelSizes", "valueCount", "pointLabelOpts", "additionalAngle", "PI", "i", "pointPosition", "plFont", "toFont", "textSize", "angleRadians", "_normalizeAngle", "toDegrees", "hLimits", "vLimits", "updateLimits", "buildPointLabelItems", "sin", "cos", "x", "y", "items", "extra", "outerDistance", "pointLabelPosition", "HALF_PI", "yForAngle", "textAlign", "getTextAlignForAngle", "left", "leftForTextAlign", "w", "align", "h", "drawPointLabels", "labelCount", "pointLabels", "optsAtIndex", "top", "right", "bottom", "backdropColor", "borderRadius", "toTRBLCorners", "backdropLeft", "backdropTop", "backdropWidth", "backdropHeight", "addRoundedRectPath", "renderText", "pathRadiusLine", "radius", "circular", "TAU", "drawRadiusLine", "gridLineOpts", "color", "lineWidth", "createPointLabelContext", "parent", "createContext", "RadialLinearScale", "callback", "leftMovement", "rightMovement", "topMovement", "bottomMovement", "angleMultiplier", "startAngle", "scalingFactor", "distance", "scaledDistance", "pointLabel", "distanceFromCenter", "backgroundColor", "angleLines", "grid", "position", "tick", "width", "INTERVALS", "UNITS", "sorter", "a", "b", "parse", "input", "adapter", "parser", "round", "isoWeekday", "isNumber", "determineUnitForAutoTicks", "minUnit", "capacity", "ilen", "interval", "determineUnitForFormatting", "numTicks", "determineMajorUnit", "addTick", "time", "timestamps", "lo", "hi", "_lookup", "timestamp", "setMajorTicks", "map", "majorUnit", "major", "ticksFromTimestamps", "values", "TimeScale", "props", "scaleOpts", "adapters", "mergeIf", "options", "_applyBounds", "arr", "timeOpts", "_filterBetween", "limit", "minor", "weekday", "hasWeekday", "format", "formats", "minorFormat", "majorFormat", "formatter", "offsets", "ticksOpts", "tickLabelWidth", "cosRotation", "sinRotation", "tickFontSize", "exampleTime", "displayFormats", "exampleLabel", "metas", "_arrayUnique", "interpolate", "table", "val", "reverse", "prevSource", "nextSource", "prevTarget", "nextTarget", "_lookupByKey", "span", "TimeSeriesScale", "prev", "curr", "next", "data", "divmod", "value", "lambda", "toStonesAndPounds", "value", "negative", "correctValue", "stones", "pounds", "divmod", "weight", "Chart", "LineController", "plugin_tooltip", "plugin_legend", "CategoryScale", "LinearScale", "PointElement", "LineElement", "getLabels", "weekData", "chart_controller_default", "Controller", "borderColour", "textColour", "computedStyle", "data", "raw", "toStonesAndPounds", "value", "c", "Controller", "h", "HOOKS", "defaults", "err", "givenDate", "date", "week1", "english", "nth", "s", "default_default", "pad", "number", "length", "int", "bool", "debounce", "fn", "wait", "_this", "args", "arrayify", "obj", "toggleClass", "elem", "className", "bool", "createElement", "tag", "content", "e", "clearNode", "node", "findParent", "condition", "createNumberInput", "inputClassName", "opts", "wrapper", "numInput", "arrowUp", "arrowDown", "key", "getEventTarget", "event", "path", "doNothing", "monthToStr", "monthNumber", "shorthand", "locale", "revFormat", "dateObj", "monthName", "hour", "day", "amPM", "int", "shortMonth", "seconds", "_", "unixSeconds", "weekNum", "weekNumber", "date", "year", "ISODate", "minutes", "month", "unixMillSeconds", "tokenRegex", "formats", "options", "pad", "createDateFormatter", "_a", "_b", "config", "defaults", "_c", "l10n", "english", "_d", "isMobile", "dateObj", "frmt", "overrideLocale", "locale", "c", "i", "arr", "formats", "createDateParser", "date", "givenFormat", "timeless", "customLocale", "parsedDate", "dateOrig", "format", "datestr", "matched", "ops", "matchIndex", "regexStr", "token", "isBackSlash", "escaped", "tokenRegex", "match", "revFormat", "fn", "val", "compareDates", "date1", "date2", "isBetween", "ts", "ts1", "ts2", "calculateSecondsSinceMidnight", "hours", "minutes", "seconds", "parseSeconds", "secondsSinceMidnight", "duration", "getDefaultHours", "config", "minHour", "minMinutes", "minSeconds", "maxHr", "maxMinutes", "target", "args", "_i", "_loop_1", "source", "key", "_a", "args_1", "__assign", "t", "s", "i", "n", "p", "__spreadArrays", "il", "r", "k", "a", "j", "jl", "DEBOUNCED_CHANGE_MS", "FlatpickrInstance", "element", "instanceConfig", "self", "defaults", "flatpickr", "default_default", "createDateParser", "bind", "setHoursFromDate", "positionCalendar", "changeMonth", "changeYear", "clear", "close", "onMouseOver", "createElement", "createDay", "destroy", "isEnabled", "jumpToDate", "updateValue", "open", "redraw", "set", "setDate", "toggle", "setupHelperFunctions", "month", "yr", "init", "parseConfig", "setupLocale", "setupInputs", "setupDates", "build", "bindEvents", "setCalendarWidth", "isSafari", "triggerEvent", "getClosestActiveElement", "_a", "bindToInstance", "fn", "config", "daysWidth", "updateTime", "e", "defaultDate", "compareDates", "getDefaultHours", "timeWrapper", "prevValue", "setHoursFromInputs", "ampm2military", "hour", "amPM", "int", "military2ampm", "hours", "minutes", "seconds", "limitMinHours", "limitMaxHours", "minBound", "calculateSecondsSinceMidnight", "maxBound", "currentTime", "result", "parseSeconds", "maxTime", "minTime", "setHours", "dateObj", "date", "pad", "onYearInput", "event", "eventTarget", "getEventTarget", "year", "handler", "options", "ev", "el", "triggerChange", "evt", "setupMobile", "debouncedResize", "debounce", "onResize", "onKeyDown", "documentClick", "onMonthNavClick", "selectDate", "selText", "timeIncrement", "onBlur", "jumpDate", "jumpTo", "oldYear", "oldMonth", "buildMonthSwitch", "incrementNumInput", "delta", "inputElem", "target", "input", "createEvent", "fragment", "buildMonthNav", "buildWeeks", "weekWrapper", "weekNumbers", "buildWeekdays", "buildDays", "buildTime", "toggleClass", "customAppend", "wrapper", "className", "_dayNumber", "dateIsEnabled", "dayElement", "isDateSelected", "isDateInRange", "focusOnDayElem", "targetNode", "getFirstAvailableDay", "startMonth", "endMonth", "m", "startIndex", "endIndex", "c", "getNextAvailableDay", "current", "givenMonth", "loopDelta", "numMonthDays", "focusOnDay", "offset", "activeElement", "dayFocused", "isInView", "startElem", "buildMonthDays", "firstOfMonth", "prevMonthDays", "daysInMonth", "days", "isMultiMonth", "prevMonthDayClass", "nextMonthDayClass", "dayNumber", "dayIndex", "dayNum", "dayContainer", "clearNode", "frag", "d", "shouldBuildMonth", "monthToStr", "buildMonth", "container", "monthNavFragment", "monthElement", "selectedMonth", "yearInput", "createNumberInput", "yearElement", "currentMonth", "buildMonths", "bool", "updateNavigationCurrentMonth", "separator", "hourInput", "minuteInput", "secondInput", "updateWeekdays", "firstDayOfWeek", "weekdays", "value", "isOffset", "triggerChangeEvent", "toInitial", "isCalendarElem", "elem", "eventTarget_1", "isCalendarElement", "isInput", "lostFocus", "isIgnored", "newYear", "newYearNum", "isNewYear", "timeless", "dateToCheck", "array", "parsed", "valueChanged", "getDateStr", "allowInput", "allowKeydown", "allowInlineKeydown", "isTimeObj", "focusAndClose", "delta_1", "elems", "x", "cellClass", "hoverDate", "initialDate", "rangeStartDate", "rangeEndDate", "containsDisabled", "minRange", "maxRange", "duration", "hoverableCells", "dayElem", "timestamp", "outOfRange", "isBetween", "positionElement", "wasOpen", "minMaxDateSetter", "type", "inverseDateObj", "boolOpts", "userConfig", "formats", "dates", "parseDateRules", "timeMode", "defaultDateFormat", "defaultAltFormat", "minMaxTimeSetter", "val", "HOOKS", "hook", "arrayify", "pluginConf", "key", "getInputElem", "tokenRegex", "createDateFormatter", "customPositionElement", "calendarHeight", "acc", "child", "calendarWidth", "configPos", "configPosVertical", "configPosHorizontal", "inputBounds", "distanceFromBottom", "showOnTop", "top", "left", "isCenter", "isRight", "right", "rightMost", "centerMost", "doc", "getDocumentStyleSheet", "bodyWidth", "centerLeft", "centerBefore", "centerAfter", "centerIndex", "centerStyle", "editableSheet", "sheet", "createStyleSheet", "style", "isSelectable", "day", "findParent", "selectedDate", "shouldChangeMonth", "selectedIndex", "b", "single", "range", "CALLBACKS", "updatePositionElement", "option", "setSelectedDate", "inputDate", "format", "arr", "rule", "preloadedDate", "inputType", "data", "hooks", "name", "specificFormat", "dObj", "isPrevMonth", "isNextMonth", "isKeyDown", "min", "max", "step", "curValue", "newValue", "isHourElem", "isMinuteElem", "_flatpickr", "nodeList", "nodes", "instances", "node", "selector", "l10n", "esm_default", "camelize", "value", "replace", "_", "char", "toUpperCase", "capitalize", "charAt", "slice", "dasherize", "toLowerCase", "readInheritableStaticArrayValues", "constructor", "propertyName", "ancestors", "getAncestorsForConstructor", "Array", "from", "reduce", "values", "getOwnStaticArrayValues", "forEach", "name", "add", "Set", "readInheritableStaticObjectPairs", "pairs", "push", "getOwnStaticObjectPairs", "Object", "getPrototypeOf", "reverse", "definition", "isArray", "keys", "map", "key", "extend", "extendWithReflect", "extended", "Reflect", "construct", "arguments", "new", "prototype", "create", "setPrototypeOf", "testReflectExtension", "b", "a", "call", "ClassPropertiesBlessing", "properties", "classDefinition", "assign", "propertiesForClassDefinition", "get", "classes", "has", "attribute", "getAttributeName", "Error", "getAll", "TargetPropertiesBlessing", "targetDefinition", "propertiesForTargetDefinition", "target", "targets", "find", "identifier", "findAll", "ValuePropertiesBlessing", "valueDefinitionPairs", "propertyDescriptorMap", "valueDescriptorMap", "result", "valueDefinitionPair", "valueDescriptor", "parseValueDefinitionPair", "attributeName", "data", "getAttributeNameForKey", "propertiesForValueDefinitionPair", "reader", "read", "writer", "write", "defaultValue", "set", "undefined", "delete", "hasCustomDefaultValue", "token", "typeDefinition", "valueDescriptorForTokenAndTypeDefinition", "parseValueTypeConstant", "constant", "Boolean", "Number", "String", "parseValueTypeDefault", "toString", "parseValueTypeObject", "typeObject", "typeFromObject", "type", "defaultValueType", "default", "parseValueTypeDefinition", "typeFromDefaultValue", "typeFromConstant", "defaultValueForDefinition", "defaultValuesByType", "readers", "writers", "array", "boolean", "number", "object", "string", "JSON", "parse", "TypeError", "writeString", "writeJSON", "stringify", "Controller", "context", "shouldLoad", "application", "scope", "element", "initialize", "connect", "disconnect", "dispatch", "eventName", "detail", "prefix", "bubbles", "cancelable", "event", "CustomEvent", "dispatchEvent", "blessings", "kebabCase", "booleanOptions", "stringOptions", "numberOptions", "arrayOptions", "arrayOrStringOptions", "dateOptions", "dateFormats", "options", "date", "arrayOrString", "events", "elements", "mapping", "strftimeRegex", "RegExp", "join", "convertDateFormat", "format", "match", "StimulusFlatpickr", "config", "_initializeEvents", "_initializeOptions", "_initializeDateFormats", "fp", "flatpickr", "flatpickrElement", "_objectSpread2", "_initializeElements", "inputTarget", "destroy", "hook", "bind", "optionType", "option", "optionKebab", "_handleDaysOfWeek", "disableDaysOfWeek", "_validateDaysOfWeek", "disable", "_disable", "enableDaysOfWeek", "enable", "_enable", "days", "day", "parseInt", "console", "error", "includes", "getDay", "dateFormat", "val", "hasInstanceTarget", "instanceTarget", "FetchResponse", "response", "RequestInterceptor", "interceptor", "getCookie", "name", "cookies", "prefix", "cookie", "value", "compact", "object", "result", "key", "metaContent", "element", "stringEntriesFromFormData", "formData", "entries", "mergeEntries", "searchParams", "FetchRequest", "method", "url", "options", "requestInterceptor", "RequestInterceptor", "error", "response", "FetchResponse", "key", "value", "headers", "baseHeaders", "compact", "getCookie", "metaContent", "originalQuery", "params", "requestQuery", "stringEntriesFromFormData", "mergeEntries", "query", "bodyIsAString", "get", "url", "options", "FetchRequest", "post", "patch", "url", "options", "FetchRequest", "DebounceController", "Controller", "defaultWait$1", "debounce", "fn", "wait", "timeoutId", "args", "context", "params", "arg", "callback", "index", "useDebounce", "composableController", "options", "controller", "func", "name", "ThrottleController", "Controller", "command_palette_controller_default", "Controller", "event", "index", "useDebounce", "enter", "leave", "url", "turbo_es2017_esm_exports", "lastItemIndex", "options", "element", "idx", "id", "term", "get", "error", "el", "custom_field_form_default", "Controller", "value", "event", "type", "dashboard_controller_default", "Controller", "get", "date_filter_controller_default", "Controller", "event", "url", "turbo_es2017_esm_exports", "filters_controller_default", "Controller", "enter", "leave", "event", "name", "checked", "value", "type", "url", "module", "main", "global", "isWorker", "workerSize", "canUseWorker", "canUsePaths", "canDrawBitmap", "canvas", "ctx", "bitmap", "noop", "promise", "func", "ModulePromise", "Prom", "bitmapMapper", "skipTransform", "map", "raf", "TIME", "frame", "cancel", "frames", "lastFrameTime", "cb", "id", "onFrame", "time", "timer", "getWorker", "worker", "prom", "resolves", "decorate", "execute", "options", "callback", "offscreen", "size", "done", "resolve", "workerDone", "msg", "code", "e", "defaults", "convert", "val", "transform", "isOk", "prop", "name", "onlyPositiveInt", "number", "randomInt", "min", "max", "toDecimal", "str", "colorsToRgb", "colors", "hexToRgb", "getOrigin", "origin", "setCanvasWindowSize", "setCanvasRectSize", "rect", "getCanvas", "zIndex", "ellipse", "context", "x", "y", "radiusX", "radiusY", "rotation", "startAngle", "endAngle", "antiClockwise", "randomPhysics", "opts", "radAngle", "radSpread", "updateFetti", "fetti", "progress", "x1", "y1", "x2", "y2", "transformPath2D", "scaleX", "scaleY", "width", "height", "matrix", "pattern", "rot", "innerRadius", "outerRadius", "spikes", "step", "animate", "fettis", "resizer", "animatingFettis", "animationFrame", "destroy", "onDone", "update", "confettiCannon", "globalOpts", "isLibCanvas", "allowResize", "hasResizeEventRegistered", "globalDisableForReducedMotion", "shouldUseWorker", "initialized", "preferLessMotion", "animationObj", "fireLocal", "particleCount", "angle", "spread", "startVelocity", "decay", "gravity", "drift", "ticks", "shapes", "scalar", "flat", "temp", "startX", "startY", "fire", "disableForReducedMotion", "onResize", "obj", "defaultFire", "getDefaultFire", "pathString", "pathMatrix", "path2d", "t1", "t2", "shapeFromPath", "pathData", "path", "tempCanvas", "tempCtx", "maxSize", "minX", "minY", "maxX", "maxY", "maxDesiredSize", "scale", "shapeFromText", "textData", "text", "color", "fontFamily", "fontSize", "font", "padding", "confetti_module_default", "create", "fireworks", "animationEnd", "defaults", "randomInRange", "min", "max", "interval", "timeLeft", "particleCount", "confetti_module_default", "stars", "origin", "shoot", "fireworks_controller_default", "Controller", "stars", "fireworks", "grouped_select_controller_default", "Controller", "source", "groups", "group", "label", "options", "_event", "target", "selectedOption", "option", "optionElement", "NestedFormController", "Controller", "count", "content", "event", "wrapper", "input", "fields", "idx", "field", "label", "prototype", "submitter", "validateSubmitter", "form", "raise", "errorConstructor", "message", "name", "message_composer_controller_default", "Controller", "event", "value", "previousValue", "patch", "messages_list_controller_default", "Controller", "mutationList", "observer", "post", "note_composer_controller_default", "Controller", "event", "isff", "addEvent", "object", "event", "method", "useCapture", "removeEvent", "getMods", "modifier", "key", "mods", "getKeys", "keys", "index", "compareArray", "a1", "a2", "arr1", "arr2", "isIndex", "i", "_keyMap", "_modifier", "modifierMap", "_mods", "_handlers", "k", "_downKeys", "winListendFocus", "_scope", "elementEventMap", "code", "x", "getKey", "getModifier", "setScope", "scope", "getScope", "getPressedKeyCodes", "getPressedKeyString", "c", "getAllKeyCodes", "result", "_ref", "shortcut", "v", "filter", "target", "tagName", "flag", "isInput", "isPressed", "keyCode", "deleteScope", "newScope", "handlers", "_ref2", "element", "removeKeyEvent", "clearModifier", "hotkeys", "unbind", "keysInfo", "info", "eachUnbind", "_len", "args", "_key", "_ref3", "splitKey", "originKey", "unbindKeys", "len", "lastKey", "unbindElements", "record", "isUnbind", "eventHandler", "handler", "modifiersMatch", "y", "dispatch", "asterisk", "keyName", "keyNum", "e", "handlerKey", "keyLen", "keyShortcut", "_downKeysCurrent", "a", "option", "keyup", "keydown", "capture", "single", "keydownListener", "keyupListenr", "listener", "trigger", "item", "data", "values", "_ref4", "el", "_api", "_hotkeys", "deep", "DebounceController", "Controller", "ThrottleController", "Controller", "alpineNames", "defaultOptions$1", "useTransition", "composableController", "options", "_a", "_b", "_c", "controller", "targetName", "targetFromAttribute", "targetElement", "dataset", "leaveAfter", "transitioned", "hiddenClass", "preserveOriginalClass", "removeToClasses", "controllerEnter", "controllerLeave", "controllerToggleTransition", "enter", "event", "enterFromClasses", "getAttribute", "enterActiveClasses", "enterToClasses", "leaveToClasses", "removeClasses", "transition", "leave", "leaveFromClasses", "leaveActiveClasses", "toggleTransition", "element", "initialClasses", "activeClasses", "endClasses", "removeEndClasses", "stashedClasses", "cls", "addClasses", "nextAnimationFrame", "afterTransition", "initialState", "classes", "name", "datasetName", "datasetAlpineName", "isEmpty", "resolve", "duration", "str", "i", "Controller", "useTransition", "permissions_controller_default", "Controller", "checkbox", "event", "checked", "value", "readValue", "search_form_controller_default", "Controller", "event", "value", "url", "turbo_es2017_esm_exports", "ownKeys", "object", "enumerableOnly", "keys", "symbols", "sym", "_objectSpread2", "target", "i", "source", "key", "_defineProperty", "_typeof", "obj", "value", "_extends", "_objectWithoutPropertiesLoose", "excluded", "sourceKeys", "_objectWithoutProperties", "sourceSymbolKeys", "version", "userAgent", "pattern", "IE11OrLess", "Edge", "FireFox", "Safari", "IOS", "ChromeForAndroid", "captureMode", "on", "el", "event", "fn", "off", "matches", "selector", "getParentOrHost", "closest", "ctx", "includeCTX", "R_SPACE", "toggleClass", "name", "state", "className", "css", "prop", "val", "style", "matrix", "selfOnly", "appliedTransforms", "transform", "matrixFn", "find", "tagName", "iterator", "list", "i", "n", "getWindowScrollingElement", "scrollingElement", "getRect", "relativeToContainingBlock", "relativeToNonStaticParent", "undoScale", "container", "elRect", "top", "left", "bottom", "right", "height", "width", "containerRect", "elMatrix", "scaleX", "scaleY", "isScrolledPast", "elSide", "parentSide", "parent", "getParentAutoScrollElement", "elSideVal", "parentSideVal", "visible", "getChild", "childNum", "options", "includeDragEl", "currentChild", "children", "Sortable", "lastChild", "last", "index", "getRelativeScrollOffset", "offsetLeft", "offsetTop", "winScroller", "indexOfObject", "arr", "obj", "key", "includeSelf", "elem", "gotSelf", "elemCSS", "extend", "dst", "src", "isRectEqual", "rect1", "rect2", "_throttleTimeout", "throttle", "callback", "ms", "args", "_this", "cancelThrottle", "scrollBy", "x", "y", "clone", "Polymer", "$", "getChildContainingRectFromElement", "container", "options", "ghostEl", "rect", "child", "_rect$left", "_rect$top", "_rect$right", "_rect$bottom", "closest", "childRect", "getRect", "expando", "AnimationStateManager", "animationStates", "animationCallbackId", "children", "css", "Sortable", "fromRect", "_objectSpread2", "childMatrix", "matrix", "state", "target", "indexOfObject", "callback", "_this", "animating", "animationTime", "time", "toRect", "prevFromRect", "prevToRect", "animatingRect", "targetMatrix", "isRectEqual", "calculateRealTime", "currentRect", "duration", "elMatrix", "scaleX", "scaleY", "translateX", "translateY", "repaint", "plugins", "defaults", "PluginManager", "plugin", "option", "p", "eventName", "sortable", "evt", "eventNameGlobal", "el", "pluginName", "initialized", "_extends", "modified", "name", "eventProperties", "value", "modifiedValue", "dispatchEvent", "_ref", "rootEl", "targetEl", "cloneEl", "toEl", "fromEl", "oldIndex", "newIndex", "oldDraggableIndex", "newDraggableIndex", "originalEvent", "putSortable", "extraEventProperties", "onName", "IE11OrLess", "Edge", "allEventProperties", "_excluded", "pluginEvent", "data", "_objectWithoutProperties", "dragEl", "parentEl", "nextEl", "lastDownEl", "cloneHidden", "moved", "_hideGhostForTarget", "_unhideGhostForTarget", "_dispatchEvent", "info", "activeGroup", "awaitingDragStarted", "ignoreNextClick", "sortables", "tapEvt", "touchEvt", "lastDx", "lastDy", "tapDistanceLeft", "tapDistanceTop", "lastTarget", "lastDirection", "pastFirstInvertThresh", "isCircumstantialInvert", "targetMoveDistance", "ghostRelativeParent", "ghostRelativeParentInitialScroll", "_silent", "savedInputChecked", "documentExists", "PositionGhostAbsolutely", "IOS", "CSSFloatProperty", "supportDraggable", "ChromeForAndroid", "supportCssPointerEvents", "_detectDirection", "elCSS", "elWidth", "child1", "getChild", "child2", "firstChildCSS", "secondChildCSS", "firstChildWidth", "secondChildWidth", "touchingSideChild2", "_dragElInRowColumn", "dragRect", "targetRect", "vertical", "dragElS1Opp", "dragElS2Opp", "dragElOppLength", "targetS1Opp", "targetS2Opp", "targetOppLength", "_detectNearestEmptySortable", "x", "y", "ret", "threshold", "lastChild", "insideHorizontally", "insideVertically", "_prepareGroup", "toFn", "pull", "to", "from", "sameGroup", "otherGroup", "group", "originalGroup", "_typeof", "nearestEmptyInsertDetectEvent", "nearest", "event", "i", "_checkOutsideTargetEl", "dataTransfer", "Safari", "fn", "on", "preventOnFilter", "type", "touch", "originalTarget", "filter", "_saveInputCheckedState", "index", "criteria", "ownerDocument", "dragStartFn", "FireFox", "toggleClass", "find", "_disableDraggable", "off", "_nextTick", "fallback", "parent", "inserted", "getParentOrHost", "fallbackTolerance", "fallbackOffset", "ghostMatrix", "relativeScrollOffset", "getRelativeScrollOffset", "dx", "dy", "cssMatrix", "getWindowScrollingElement", "clone", "revert", "activeSortable", "isOwner", "canSort", "fromSortable", "completedFired", "dragOverEvent", "extra", "completed", "after", "_onMove", "changed", "capture", "insertion", "elLastChild", "_ghostIsLast", "_ghostIsFirst", "firstChild", "direction", "targetBeforeFirstSwap", "differentLevel", "differentRowCol", "side1", "scrolledPastTop", "isScrolledPast", "scrollBefore", "_getSwapDirection", "sibling", "dragIndex", "nextSibling", "moveVector", "_unsilent", "scrollBy", "_cancelNextTick", "_globalDragOver", "order", "n", "_generateId", "useAnimation", "items", "id", "store", "selector", "willInsertAfter", "onMoveFn", "retVal", "firstElRect", "childContainingRect", "spacer", "lastElRect", "swapThreshold", "invertedSwapThreshold", "invertSwap", "isLastTarget", "mouseOnAxis", "targetLength", "targetS1", "targetS2", "invert", "_getInsertDirection", "str", "sum", "root", "inputs", "idx", "extend", "throttle", "element", "_len", "_key", "version", "autoScrolls", "scrollEl", "scrollRootEl", "scrolling", "lastAutoScrollX", "lastAutoScrollY", "touchEvt$1", "pointerElemChangedInterval", "AutoScrollPlugin", "AutoScroll", "_ref2", "clearPointerElemChangedInterval", "clearAutoScrolls", "cancelThrottle", "elem", "autoScroll", "ogElemScroller", "getParentAutoScrollElement", "newElem", "isFallback", "sens", "speed", "winScroller", "scrollThisInstance", "scrollCustomFn", "layersOut", "currentParent", "top", "bottom", "left", "right", "width", "height", "canScrollX", "canScrollY", "scrollWidth", "scrollHeight", "scrollPosX", "scrollPosY", "vx", "vy", "scrollOffsetY", "scrollOffsetX", "drop", "dispatchSortableEvent", "hideGhostForTarget", "unhideGhostForTarget", "toSortable", "Revert", "_ref3", "Remove", "_ref4", "parentSortable", "Sortable", "AutoScrollPlugin", "Remove", "Revert", "sortable_esm_default", "sortable_controller_default", "Controller", "sortable_esm_default", "sortable", "keys", "post", "transition_controller_default", "Controller", "mutations", "attribute", "resolve", "duration", "dir", "activeClasses", "fromClasses", "toClasses", "name", "type", "event", "v", "newDisplayStyle", "turbo_controller_default", "Controller", "event", "get", "post", "turbo_modal_controller_default", "Controller", "e", "event", "scrollbarWidth", "CancellationFormController", "Controller", "event", "target", "label", "title", "description", "CurrentConversationController", "Controller", "parts", "elementId", "element", "DropdownController", "Controller", "event", "callback", "klass", "lastItemIndex", "classList", "t", "el", "logProperty", "prop", "log", "controller", "functionName", "args", "logger", "colorize", "logEvent", "controller", "eventName", "event", "element", "logger", "colorizeMany", "colorize", "text", "color", "texts", "str", "colors", "x", "dispatchEvent", "controller", "element", "eventName", "options", "mergedOptions", "event", "logEvent", "BaseController", "Controller", "context", "obj", "prop", "returnVal", "self", "logProperty", "target", "thisArg", "argArray", "log", "name", "eventName", "element", "options", "dispatchEvent", "wrapArray", "x", "debounce", "func", "wait", "immediate", "timeout", "args", "later", "callNow", "PI", "c1", "c2", "c3", "c4", "c5", "isHTMLTextAreaElement", "element", "all", "Map", "on", "type", "handler", "handlers", "get", "push", "set", "off", "splice", "indexOf", "emit", "evt", "slice", "map", "EventBus", "mitt_default", "isArray", "symbolProto", "symbolToString", "objectProto", "useMixin", "controller", "setup", "teardown", "controllerDisconnect", "useEventListener", "controller", "element", "eventNameOrNames", "handler", "opts", "debounce", "eventNames", "wrapArray", "setup", "eventName", "teardown", "useMixin", "useIntersectionObserver", "controller", "handler", "options", "observer", "element", "useIntersection", "appear", "disappear", "opts", "processEntries", "entries", "entry", "observe", "unobserve", "teardown", "useMixin", "useTimeout", "controller", "handler", "timeout", "controllerDisconnect", "timeoutHandle", "newHandler", "setup", "teardown", "useMixin", "AutosizeController", "BaseController", "teardown", "useIntersection", "isHTMLTextAreaElement", "useEventListener", "_entry", "element", "offset", "toDate", "argument", "argStr", "constructFrom", "date", "value", "addDays", "date", "amount", "_date", "toDate", "constructFrom", "addMonths", "date", "amount", "_date", "toDate", "constructFrom", "dayOfMonth", "endOfDesiredMonth", "daysInMonth", "add", "date", "duration", "years", "months", "weeks", "days", "hours", "minutes", "seconds", "_date", "toDate", "dateWithMonths", "addMonths", "dateWithDays", "addDays", "minutesToAdd", "msToAdd", "constructFrom", "maxTime", "minTime", "millisecondsInWeek", "millisecondsInDay", "millisecondsInMinute", "millisecondsInHour", "minutesInMonth", "minutesInDay", "secondsInHour", "secondsInDay", "secondsInHour", "secondsInWeek", "secondsInYear", "secondsInMonth", "secondsInQuarter", "startOfDay", "date", "_date", "toDate", "getTimezoneOffsetInMilliseconds", "date", "_date", "toDate", "utcDate", "differenceInCalendarDays", "dateLeft", "dateRight", "startOfDayLeft", "startOfDay", "startOfDayRight", "timestampLeft", "getTimezoneOffsetInMilliseconds", "timestampRight", "millisecondsInDay", "differenceInDays", "dateLeft", "dateRight", "_dateLeft", "toDate", "_dateRight", "sign", "compareLocalAsc", "difference", "differenceInCalendarDays", "isLastDayNotFull", "result", "diff", "getRoundingMethod", "method", "number", "result", "differenceInMilliseconds", "dateLeft", "dateRight", "toDate", "differenceInHours", "dateLeft", "dateRight", "options", "diff", "differenceInMilliseconds", "millisecondsInHour", "getRoundingMethod", "differenceInMinutes", "dateLeft", "dateRight", "options", "diff", "differenceInMilliseconds", "millisecondsInMinute", "getRoundingMethod", "compareAsc", "dateLeft", "dateRight", "_dateLeft", "toDate", "_dateRight", "diff", "differenceInCalendarMonths", "dateLeft", "dateRight", "_dateLeft", "toDate", "_dateRight", "yearDiff", "monthDiff", "endOfDay", "date", "_date", "toDate", "endOfMonth", "date", "_date", "toDate", "month", "isLastDayOfMonth", "date", "_date", "toDate", "endOfDay", "endOfMonth", "differenceInMonths", "dateLeft", "dateRight", "_dateLeft", "toDate", "_dateRight", "sign", "compareAsc", "difference", "differenceInCalendarMonths", "result", "isLastMonthNotFull", "isLastDayOfMonth", "differenceInSeconds", "dateLeft", "dateRight", "options", "diff", "differenceInMilliseconds", "getRoundingMethod", "differenceInCalendarYears", "dateLeft", "dateRight", "_dateLeft", "toDate", "_dateRight", "differenceInYears", "dateLeft", "dateRight", "_dateLeft", "toDate", "_dateRight", "sign", "compareAsc", "difference", "differenceInCalendarYears", "isLastYearNotFull", "result", "intervalToDuration", "interval", "start", "toDate", "end", "duration", "years", "differenceInYears", "remainingMonths", "add", "months", "differenceInMonths", "remainingDays", "days", "differenceInDays", "remainingHours", "hours", "differenceInHours", "remainingMinutes", "minutes", "differenceInMinutes", "remainingSeconds", "seconds", "differenceInSeconds", "isPast", "date", "toDate", "formatDistanceLocale", "formatDistance", "token", "count", "options", "result", "tokenValue", "buildFormatLongFn", "args", "options", "width", "dateFormats", "timeFormats", "dateTimeFormats", "formatLong", "buildFormatLongFn", "formatRelativeLocale", "formatRelative", "token", "_date", "_baseDate", "_options", "buildLocalizeFn", "args", "value", "options", "context", "valuesArray", "defaultWidth", "width", "index", "eraValues", "quarterValues", "monthValues", "dayValues", "dayPeriodValues", "formattingDayPeriodValues", "ordinalNumber", "dirtyNumber", "_options", "number", "rem100", "localize", "buildLocalizeFn", "quarter", "buildMatchFn", "args", "string", "options", "width", "matchPattern", "matchResult", "matchedString", "parsePatterns", "key", "findIndex", "pattern", "findKey", "value", "rest", "object", "predicate", "array", "buildMatchPatternFn", "args", "string", "options", "matchResult", "matchedString", "parseResult", "value", "rest", "matchOrdinalNumberPattern", "parseOrdinalNumberPattern", "matchEraPatterns", "parseEraPatterns", "matchQuarterPatterns", "parseQuarterPatterns", "matchMonthPatterns", "parseMonthPatterns", "matchDayPatterns", "parseDayPatterns", "matchDayPeriodPatterns", "parseDayPeriodPatterns", "match", "buildMatchPatternFn", "value", "buildMatchFn", "index", "enUS", "formatDistance", "formatLong", "formatRelative", "localize", "match", "defaultOptions", "getDefaultOptions", "constructNow", "date", "constructFrom", "formatDistance", "date", "baseDate", "options", "defaultOptions", "getDefaultOptions", "locale", "enUS", "minutesInAlmostTwoDays", "comparison", "compareAsc", "localizeOptions", "dateLeft", "dateRight", "toDate", "seconds", "differenceInSeconds", "offsetInSeconds", "getTimezoneOffsetInMilliseconds", "minutes", "months", "minutesInDay", "hours", "minutesInMonth", "days", "differenceInMonths", "nearestMonth", "monthsSinceStartOfYear", "years", "formatDistanceToNow", "date", "options", "formatDistance", "constructNow", "TimeDistanceController", "BaseController", "isPast", "intervalToDuration", "duration", "toDate", "formatDistanceToNow", "useTimeout", "WeighInController", "Controller", "event", "top", "bottom", "right", "left", "auto", "basePlacements", "start", "end", "clippingParents", "viewport", "popper", "reference", "variationPlacements", "acc", "placement", "placements", "beforeRead", "read", "afterRead", "beforeMain", "main", "afterMain", "beforeWrite", "write", "afterWrite", "modifierPhases", "getNodeName", "element", "getWindow", "node", "ownerDocument", "isElement", "node", "OwnElement", "getWindow", "isHTMLElement", "isShadowRoot", "applyStyles", "_ref", "state", "name", "style", "attributes", "element", "isHTMLElement", "getNodeName", "value", "effect", "_ref2", "initialStyles", "styleProperties", "property", "attribute", "applyStyles_default", "getBasePlacement", "placement", "max", "min", "round", "getUAString", "uaData", "item", "isLayoutViewport", "getUAString", "getBoundingClientRect", "element", "includeScale", "isFixedStrategy", "clientRect", "scaleX", "scaleY", "isHTMLElement", "round", "_ref", "isElement", "getWindow", "visualViewport", "addVisualOffsets", "isLayoutViewport", "x", "y", "width", "height", "getLayoutRect", "element", "clientRect", "getBoundingClientRect", "width", "height", "contains", "parent", "child", "rootNode", "isShadowRoot", "next", "getComputedStyle", "element", "getWindow", "isTableElement", "element", "getNodeName", "getDocumentElement", "element", "isElement", "getParentNode", "element", "getNodeName", "isShadowRoot", "getDocumentElement", "getTrueOffsetParent", "element", "isHTMLElement", "getComputedStyle", "getContainingBlock", "isFirefox", "getUAString", "isIE", "elementCss", "currentNode", "getParentNode", "isShadowRoot", "getNodeName", "css", "getOffsetParent", "window", "getWindow", "offsetParent", "isTableElement", "getMainAxisFromPlacement", "placement", "within", "min", "value", "max", "withinMaxClamp", "v", "getFreshSideObject", "mergePaddingObject", "paddingObject", "getFreshSideObject", "expandToHashMap", "value", "keys", "hashMap", "key", "toPaddingObject", "padding", "state", "mergePaddingObject", "expandToHashMap", "basePlacements", "arrow", "_ref", "_state$modifiersData$", "name", "options", "arrowElement", "popperOffsets", "basePlacement", "getBasePlacement", "axis", "getMainAxisFromPlacement", "isVertical", "left", "right", "len", "paddingObject", "arrowRect", "getLayoutRect", "minProp", "top", "maxProp", "bottom", "endDiff", "startDiff", "arrowOffsetParent", "getOffsetParent", "clientSize", "centerToReference", "min", "max", "center", "offset", "within", "axisProp", "effect", "_ref2", "_options$element", "contains", "arrow_default", "getVariation", "placement", "unsetSides", "roundOffsetsByDPR", "_ref", "win", "x", "y", "dpr", "round", "mapToStyles", "_ref2", "_Object$assign2", "popper", "popperRect", "placement", "variation", "offsets", "position", "gpuAcceleration", "adaptive", "roundOffsets", "isFixed", "_offsets$x", "_offsets$y", "_ref3", "hasX", "hasY", "sideX", "left", "sideY", "top", "offsetParent", "getOffsetParent", "heightProp", "widthProp", "getWindow", "getDocumentElement", "getComputedStyle", "right", "end", "bottom", "offsetY", "offsetX", "commonStyles", "_ref4", "_Object$assign", "computeStyles", "_ref5", "state", "options", "_options$gpuAccelerat", "_options$adaptive", "_options$roundOffsets", "getBasePlacement", "getVariation", "computeStyles_default", "passive", "effect", "_ref", "state", "instance", "options", "_options$scroll", "scroll", "_options$resize", "resize", "window", "getWindow", "scrollParents", "scrollParent", "eventListeners_default", "hash", "getOppositePlacement", "placement", "matched", "hash", "getOppositeVariationPlacement", "placement", "matched", "getWindowScroll", "node", "win", "getWindow", "scrollLeft", "scrollTop", "getWindowScrollBarX", "element", "getBoundingClientRect", "getDocumentElement", "getWindowScroll", "getViewportRect", "element", "strategy", "win", "getWindow", "html", "getDocumentElement", "visualViewport", "width", "height", "x", "y", "layoutViewport", "isLayoutViewport", "getWindowScrollBarX", "getDocumentRect", "element", "_element$ownerDocumen", "html", "getDocumentElement", "winScroll", "getWindowScroll", "body", "width", "max", "height", "x", "getWindowScrollBarX", "y", "getComputedStyle", "isScrollParent", "element", "_getComputedStyle", "getComputedStyle", "overflow", "overflowX", "overflowY", "getScrollParent", "node", "getNodeName", "isHTMLElement", "isScrollParent", "getParentNode", "listScrollParents", "element", "list", "_element$ownerDocumen", "scrollParent", "getScrollParent", "isBody", "win", "getWindow", "target", "isScrollParent", "updatedList", "getParentNode", "rectToClientRect", "rect", "getInnerBoundingClientRect", "element", "strategy", "rect", "getBoundingClientRect", "getClientRectFromMixedType", "clippingParent", "viewport", "rectToClientRect", "getViewportRect", "isElement", "getDocumentRect", "getDocumentElement", "getClippingParents", "clippingParents", "listScrollParents", "getParentNode", "canEscapeClipping", "getComputedStyle", "clipperElement", "isHTMLElement", "getOffsetParent", "contains", "getNodeName", "getClippingRect", "boundary", "rootBoundary", "mainClippingParents", "firstClippingParent", "clippingRect", "accRect", "max", "min", "computeOffsets", "_ref", "reference", "element", "placement", "basePlacement", "getBasePlacement", "variation", "getVariation", "commonX", "commonY", "offsets", "top", "bottom", "right", "left", "mainAxis", "getMainAxisFromPlacement", "len", "start", "end", "detectOverflow", "state", "options", "_options", "_options$placement", "placement", "_options$strategy", "strategy", "_options$boundary", "boundary", "clippingParents", "_options$rootBoundary", "rootBoundary", "viewport", "_options$elementConte", "elementContext", "popper", "_options$altBoundary", "altBoundary", "_options$padding", "padding", "paddingObject", "mergePaddingObject", "expandToHashMap", "basePlacements", "altContext", "reference", "popperRect", "element", "clippingClientRect", "getClippingRect", "isElement", "getDocumentElement", "referenceClientRect", "getBoundingClientRect", "popperOffsets", "computeOffsets", "popperClientRect", "rectToClientRect", "elementClientRect", "overflowOffsets", "offsetData", "offset", "key", "multiply", "right", "bottom", "axis", "top", "computeAutoPlacement", "state", "options", "_options", "placement", "boundary", "rootBoundary", "padding", "flipVariations", "_options$allowedAutoP", "allowedAutoPlacements", "placements", "variation", "getVariation", "variationPlacements", "basePlacements", "allowedPlacements", "overflows", "acc", "detectOverflow", "getBasePlacement", "a", "b", "getExpandedFallbackPlacements", "placement", "getBasePlacement", "auto", "oppositePlacement", "getOppositePlacement", "getOppositeVariationPlacement", "flip", "_ref", "state", "options", "name", "_options$mainAxis", "checkMainAxis", "_options$altAxis", "checkAltAxis", "specifiedFallbackPlacements", "padding", "boundary", "rootBoundary", "altBoundary", "_options$flipVariatio", "flipVariations", "allowedAutoPlacements", "preferredPlacement", "basePlacement", "isBasePlacement", "fallbackPlacements", "placements", "acc", "computeAutoPlacement", "referenceRect", "popperRect", "checksMap", "makeFallbackChecks", "firstFittingPlacement", "i", "_basePlacement", "isStartVariation", "getVariation", "start", "isVertical", "top", "bottom", "len", "overflow", "detectOverflow", "mainVariationSide", "right", "left", "altVariationSide", "checks", "check", "numberOfChecks", "_loop", "_i", "fittingPlacement", "_ret", "flip_default", "getSideOffsets", "overflow", "rect", "preventedOffsets", "isAnySideFullyClipped", "top", "right", "bottom", "left", "side", "hide", "_ref", "state", "name", "referenceRect", "popperRect", "referenceOverflow", "detectOverflow", "popperAltOverflow", "referenceClippingOffsets", "popperEscapeOffsets", "isReferenceHidden", "hasPopperEscaped", "hide_default", "distanceAndSkiddingToXY", "placement", "rects", "offset", "basePlacement", "getBasePlacement", "invertDistance", "left", "top", "_ref", "skidding", "distance", "right", "_ref2", "state", "options", "name", "_options$offset", "data", "placements", "acc", "_data$state$placement", "x", "y", "offset_default", "popperOffsets", "_ref", "state", "name", "computeOffsets", "popperOffsets_default", "getAltAxis", "axis", "preventOverflow", "_ref", "state", "options", "name", "_options$mainAxis", "checkMainAxis", "_options$altAxis", "checkAltAxis", "boundary", "rootBoundary", "altBoundary", "padding", "_options$tether", "tether", "_options$tetherOffset", "tetherOffset", "overflow", "detectOverflow", "basePlacement", "getBasePlacement", "variation", "getVariation", "isBasePlacement", "mainAxis", "getMainAxisFromPlacement", "altAxis", "getAltAxis", "popperOffsets", "referenceRect", "popperRect", "tetherOffsetValue", "normalizedTetherOffsetValue", "offsetModifierState", "data", "_offsetModifierState$", "mainSide", "top", "left", "altSide", "bottom", "right", "len", "offset", "min", "max", "additive", "minLen", "start", "maxLen", "arrowElement", "arrowRect", "getLayoutRect", "arrowPaddingObject", "getFreshSideObject", "arrowPaddingMin", "arrowPaddingMax", "arrowLen", "within", "minOffset", "maxOffset", "arrowOffsetParent", "getOffsetParent", "clientOffset", "offsetModifierValue", "tetherMin", "tetherMax", "preventedOffset", "_offsetModifierState$2", "_mainSide", "_altSide", "_offset", "_len", "_min", "_max", "isOriginSide", "_offsetModifierValue", "_tetherMin", "_tetherMax", "_preventedOffset", "withinMaxClamp", "preventOverflow_default", "getHTMLElementScroll", "element", "getNodeScroll", "node", "getWindow", "isHTMLElement", "getWindowScroll", "getHTMLElementScroll", "isElementScaled", "element", "rect", "scaleX", "round", "scaleY", "getCompositeRect", "elementOrVirtualElement", "offsetParent", "isFixed", "isOffsetParentAnElement", "isHTMLElement", "offsetParentIsScaled", "documentElement", "getDocumentElement", "getBoundingClientRect", "scroll", "offsets", "getNodeName", "isScrollParent", "getNodeScroll", "getWindowScrollBarX", "order", "modifiers", "map", "visited", "result", "modifier", "sort", "requires", "dep", "depModifier", "orderModifiers", "orderedModifiers", "modifierPhases", "acc", "phase", "debounce", "fn", "pending", "resolve", "mergeByName", "modifiers", "merged", "current", "existing", "key", "DEFAULT_OPTIONS", "areValidElements", "_len", "args", "_key", "element", "popperGenerator", "generatorOptions", "_generatorOptions", "_generatorOptions$def", "defaultModifiers", "_generatorOptions$def2", "defaultOptions", "reference", "popper", "options", "state", "effectCleanupFns", "isDestroyed", "instance", "setOptionsAction", "cleanupModifierEffects", "isElement", "listScrollParents", "orderedModifiers", "orderModifiers", "mergeByName", "runModifierEffects", "_state$elements", "getCompositeRect", "getOffsetParent", "getLayoutRect", "modifier", "index", "_state$orderedModifie", "fn", "_state$orderedModifie2", "_options", "name", "debounce", "resolve", "_ref", "_ref$options", "effect", "cleanupFn", "noopFn", "defaultModifiers", "eventListeners_default", "popperOffsets_default", "computeStyles_default", "applyStyles_default", "offset_default", "flip_default", "preventOverflow_default", "arrow_default", "hide_default", "createPopper", "popperGenerator", "BOX_CLASS", "CONTENT_CLASS", "BACKDROP_CLASS", "ARROW_CLASS", "SVG_ARROW_CLASS", "TOUCH_OPTIONS", "passive", "capture", "TIPPY_DEFAULT_APPEND_TO", "document", "body", "getValueAtIndexOrReturn", "value", "index", "defaultValue", "Array", "isArray", "v", "isType", "type", "str", "toString", "call", "indexOf", "invokeWithArgsOrReturn", "args", "debounce", "fn", "ms", "timeout", "arg", "clearTimeout", "setTimeout", "splitBySpaces", "value", "split", "filter", "Boolean", "normalizeToArray", "concat", "pushIfUnique", "arr", "indexOf", "push", "unique", "item", "index", "getBasePlacement", "placement", "arrayFrom", "slice", "call", "removeUndefinedProps", "obj", "Object", "keys", "reduce", "acc", "key", "undefined", "div", "document", "createElement", "isElement", "some", "type", "isType", "isNodeList", "isMouseEvent", "isReferenceElement", "_tippy", "reference", "getArrayOfElements", "Array", "isArray", "querySelectorAll", "setTransitionDuration", "els", "forEach", "el", "style", "transitionDuration", "setVisibilityState", "state", "setAttribute", "getOwnerDocument", "elementOrElements", "_element$ownerDocumen", "_normalizeToArray", "element", "ownerDocument", "body", "isCursorOutsideInteractiveBorder", "popperTreeData", "event", "clientX", "clientY", "every", "_ref", "popperRect", "popperState", "props", "interactiveBorder", "basePlacement", "offsetData", "modifiersData", "offset", "topDistance", "top", "y", "bottomDistance", "bottom", "leftDistance", "left", "x", "rightDistance", "right", "exceedsTop", "exceedsBottom", "exceedsLeft", "exceedsRight", "updateTransitionEndListener", "box", "action", "listener", "method", "actualContains", "parent", "child", "target", "_target$getRootNode", "contains", "getRootNode", "host", "currentInput", "isTouch", "lastMouseMoveTime", "onDocumentTouchStart", "window", "performance", "addEventListener", "onDocumentMouseMove", "now", "removeEventListener", "onWindowBlur", "activeElement", "instance", "blur", "isVisible", "bindGlobalEventListeners", "TOUCH_OPTIONS", "isBrowser", "isIE11", "msCrypto", "pluginProps", "animateFill", "followCursor", "inlinePositioning", "sticky", "renderProps", "allowHTML", "animation", "arrow", "content", "inertia", "maxWidth", "role", "theme", "zIndex", "defaultProps", "appendTo", "TIPPY_DEFAULT_APPEND_TO", "aria", "expanded", "delay", "duration", "getReferenceClientRect", "hideOnClick", "ignoreAttributes", "interactive", "interactiveBorder", "interactiveDebounce", "moveTransition", "offset", "onAfterUpdate", "onBeforeUpdate", "onCreate", "onDestroy", "onHidden", "onHide", "onMount", "onShow", "onShown", "onTrigger", "onUntrigger", "onClickOutside", "placement", "plugins", "popperOptions", "render", "showOnCreate", "touch", "trigger", "triggerTarget", "defaultKeys", "Object", "keys", "setDefaultProps", "partialProps", "forEach", "key", "getExtendedPassedProps", "passedProps", "reduce", "acc", "plugin", "name", "defaultValue", "_name", "undefined", "getDataAttributeProps", "reference", "propKeys", "props", "valueAsString", "getAttribute", "trim", "JSON", "parse", "evaluateProps", "out", "invokeWithArgsOrReturn", "innerHTML", "dangerouslySetInnerHTML", "element", "html", "createArrowElement", "value", "arrow", "div", "className", "ARROW_CLASS", "SVG_ARROW_CLASS", "isElement", "appendChild", "setContent", "content", "props", "allowHTML", "textContent", "getChildren", "popper", "box", "firstElementChild", "boxChildren", "arrayFrom", "children", "find", "node", "classList", "contains", "CONTENT_CLASS", "backdrop", "BACKDROP_CLASS", "render", "instance", "BOX_CLASS", "setAttribute", "onUpdate", "prevProps", "nextProps", "_getChildren", "theme", "removeAttribute", "animation", "inertia", "style", "maxWidth", "role", "removeChild", "$$tippy", "idCounter", "mouseMoveListeners", "mountedInstances", "createTippy", "reference", "passedProps", "evaluateProps", "defaultProps", "getExtendedPassedProps", "removeUndefinedProps", "showTimeout", "hideTimeout", "scheduleHideAnimationFrame", "isVisibleFromClick", "didHideDueToDocumentMouseDown", "didTouchMove", "ignoreOnFirstUpdate", "lastTriggerEvent", "currentTransitionEndListener", "onFirstUpdate", "listeners", "debouncedOnMouseMove", "debounce", "onMouseMove", "interactiveDebounce", "currentTarget", "id", "popperInstance", "plugins", "unique", "state", "isEnabled", "isVisible", "isDestroyed", "isMounted", "isShown", "clearDelayTimeouts", "setProps", "show", "hide", "hideWithInteractivity", "enable", "disable", "unmount", "destroy", "_props$render", "_tippy", "pluginsHooks", "map", "plugin", "fn", "hasAriaExpanded", "hasAttribute", "addListeners", "handleAriaExpandedAttribute", "handleStyles", "invokeHook", "showOnCreate", "scheduleShow", "addEventListener", "interactive", "trigger", "indexOf", "getDocument", "getNormalizedTouchSettings", "touch", "Array", "isArray", "getIsCustomTouchBehavior", "getIsDefaultRenderFn", "_instance$props$rende", "getCurrentTarget", "parent", "parentNode", "getOwnerDocument", "document", "getDefaultTemplateChildren", "getDelay", "isShow", "currentInput", "isTouch", "type", "getValueAtIndexOrReturn", "delay", "fromHide", "pointerEvents", "zIndex", "hook", "args", "shouldInvokePropsHook", "forEach", "pluginHooks", "_instance$props", "handleAriaContentAttribute", "aria", "attr", "nodes", "normalizeToArray", "triggerTarget", "currentValue", "getAttribute", "nextValue", "replace", "trim", "expanded", "cleanupInteractiveMouseListeners", "removeEventListener", "filter", "listener", "onDocumentPress", "event", "actualTarget", "composedPath", "target", "actualContains", "some", "el", "hideOnClick", "setTimeout", "removeDocumentPress", "onTouchMove", "onTouchStart", "addDocumentPress", "doc", "TOUCH_OPTIONS", "onTransitionedOut", "duration", "callback", "onTransitionEnd", "onTransitionedIn", "updateTransitionEndListener", "on", "eventType", "handler", "options", "push", "onTrigger", "passive", "onMouseLeave", "splitBySpaces", "isIE11", "onBlurOrFocusOut", "removeListeners", "_ref", "_lastTriggerEvent", "shouldScheduleClickHide", "isEventListenerStopped", "wasFocused", "isMouseEvent", "scheduleHide", "isCursorOverReferenceOrPopper", "popperTreeData", "getNestedPopperTree", "concat", "_instance$popperInsta", "popperRect", "getBoundingClientRect", "popperState", "Boolean", "isCursorOutsideInteractiveBorder", "shouldBail", "relatedTarget", "createPopperInstance", "destroyPopperInstance", "_instance$props2", "popperOptions", "placement", "offset", "getReferenceClientRect", "moveTransition", "computedReference", "contextElement", "tippyModifier", "name", "enabled", "phase", "requires", "_ref2", "_getDefaultTemplateCh", "attributes", "modifiers", "padding", "top", "bottom", "left", "right", "adaptive", "createPopper", "mount", "appendTo", "TIPPY_DEFAULT_APPEND_TO", "invokeWithArgsOrReturn", "querySelectorAll", "_getNormalizedTouchSe", "touchValue", "touchDelay", "requestAnimationFrame", "clearTimeout", "cancelAnimationFrame", "partialProps", "ignoreAttributes", "nestedPopper", "forceUpdate", "isAlreadyVisible", "isDisabled", "isTouchAndTouchDisabled", "onShow", "visibility", "transition", "_getDefaultTemplateCh2", "setTransitionDuration", "_instance$popperInsta2", "offsetHeight", "_getDefaultTemplateCh3", "setVisibilityState", "pushIfUnique", "isAlreadyHidden", "onHide", "_getDefaultTemplateCh4", "i", "tippy", "targets", "optionalProps", "bindGlobalEventListeners", "elements", "getArrayOfElements", "isSingleContentElement", "isMoreThanOneReferenceElement", "instances", "reduce", "acc", "setDefaultProps", "applyStylesModifier", "applyStyles", "effect", "_ref", "state", "initialStyles", "popper", "position", "options", "strategy", "left", "top", "margin", "arrow", "reference", "Object", "assign", "elements", "style", "styles", "tippy", "setDefaultProps", "render", "TooltipController", "Controller", "tippy_esm_default", "ModalController", "Controller", "enter", "promises", "leave", "event", "scrollbarWidth", "import_croppie", "import_compressorjs", "AvatarPickerController", "Controller", "blob", "result", "resolve", "reject", "Compressor", "now", "error", "file", "input", "url", "DirectUpload", "hiddenField", "_event", "files", "modal", "panel", "reader", "image", "Croppie", "compressedFile", "objectURL", "height", "width", "slice", "options", "vnodeId", "isValidElement", "rerenderQueue", "prevDebounce", "defer", "depthSort", "CAPTURE_REGEX", "eventClock", "eventProxy", "eventProxyCapture", "i", "EMPTY_OBJ", "EMPTY_ARR", "IS_NON_DIMENSIONAL", "isArray", "Array", "assign", "obj", "props", "removeNode", "node", "parentNode", "removeChild", "createElement", "type", "children", "key", "ref", "normalizedProps", "arguments", "length", "call", "defaultProps", "createVNode", "original", "vnode", "__k", "__", "__b", "__e", "__c", "constructor", "__v", "__i", "__u", "Fragment", "props", "children", "BaseComponent", "context", "this", "getDomSibling", "vnode", "childIndex", "__", "__i", "sibling", "__k", "length", "__e", "type", "updateParentDomPointers", "i", "child", "__c", "base", "enqueueRender", "c", "__d", "rerenderQueue", "push", "process", "__r", "prevDebounce", "options", "debounceRendering", "defer", "renderQueueLength", "component", "newVNode", "oldVNode", "oldDom", "commitQueue", "refQueue", "sort", "depthSort", "shift", "__v", "__P", "assign", "diff", "__n", "namespaceURI", "__u", "commitRoot", "diffChildren", "parentDom", "renderResult", "newParentVNode", "oldParentVNode", "globalContext", "namespace", "excessDomChildren", "isHydrating", "childVNode", "newDom", "firstChildDom", "result", "oldChildren", "EMPTY_ARR", "newChildrenLength", "constructNewChildrenArray", "EMPTY_OBJ", "ref", "applyRef", "insert", "nextSibling", "skewedIndex", "matchingIndex", "oldChildrenLength", "remainingOldChildren", "skew", "Array", "constructor", "String", "createVNode", "isArray", "__b", "key", "findMatchingIndex", "unmount", "parentVNode", "contains", "insertBefore", "nodeType", "findMatchingIndex", "childVNode", "oldChildren", "skewedIndex", "remainingOldChildren", "x", "y", "key", "type", "oldVNode", "__u", "length", "setStyle", "style", "value", "setProperty", "IS_NON_DIMENSIONAL", "test", "dom", "name", "oldValue", "namespace", "useCapture", "o", "cssText", "replace", "CAPTURE_REGEX", "toLowerCase", "slice", "l", "_attached", "eventClock", "addEventListener", "eventProxyCapture", "eventProxy", "removeEventListener", "e", "removeAttribute", "setAttribute", "createEventProxy", "this", "eventHandler", "_dispatched", "options", "event", "diff", "parentDom", "newVNode", "globalContext", "excessDomChildren", "commitQueue", "oldDom", "isHydrating", "refQueue", "tmp", "c", "isNew", "oldProps", "oldState", "snapshot", "clearProcessingException", "newProps", "isClassComponent", "provider", "componentContext", "i", "renderHook", "count", "renderResult", "newType", "constructor", "__e", "__b", "outer", "props", "prototype", "render", "contextType", "__c", "__", "__E", "BaseComponent", "doRender", "sub", "state", "context", "__n", "__d", "__h", "_sb", "__s", "getDerivedStateFromProps", "assign", "__v", "componentWillMount", "componentDidMount", "push", "componentWillReceiveProps", "shouldComponentUpdate", "__k", "some", "vnode", "componentWillUpdate", "componentDidUpdate", "__P", "__r", "getChildContext", "getSnapshotBeforeUpdate", "diffChildren", "isArray", "Fragment", "children", "base", "then", "MODE_HYDRATE", "nodeType", "nextSibling", "indexOf", "removeNode", "diffElementNodes", "diffed", "commitRoot", "root", "applyRef", "cb", "call", "newHtml", "oldHtml", "newChildren", "inputValue", "checked", "localName", "document", "createTextNode", "createElementNS", "is", "__m", "data", "childNodes", "EMPTY_OBJ", "attributes", "__html", "innerHTML", "getDomSibling", "ref", "hasRefUnmount", "current", "unmount", "parentVNode", "skipRemove", "r", "componentWillUnmount", "replaceNode", "documentElement", "createElement", "namespaceURI", "firstChild", "slice", "EMPTY_ARR", "options", "__e", "error", "vnode", "oldVNode", "errorInfo", "component", "ctor", "handled", "__", "__c", "constructor", "getDerivedStateFromError", "setState", "__d", "componentDidCatch", "__E", "e", "vnodeId", "isValidElement", "undefined", "BaseComponent", "prototype", "update", "callback", "s", "this", "__s", "state", "assign", "props", "__v", "_sb", "push", "enqueueRender", "forceUpdate", "__h", "render", "Fragment", "rerenderQueue", "defer", "Promise", "then", "bind", "resolve", "setTimeout", "depthSort", "a", "b", "__b", "process", "__r", "CAPTURE_REGEX", "eventClock", "eventProxy", "createEventProxy", "eventProxyCapture", "i", "currentIndex", "currentComponent", "previousComponent", "prevRaf", "currentHook", "afterPaintEffects", "options", "_options", "oldBeforeDiff", "__b", "oldBeforeRender", "__r", "oldAfterDiff", "diffed", "oldCommit", "__c", "oldBeforeUnmount", "unmount", "oldRoot", "__", "getHookState", "index", "type", "__h", "hooks", "__H", "length", "push", "useState", "initialState", "useReducer", "invokeOrReturn", "reducer", "init", "hookState", "_reducer", "action", "currentValue", "__N", "nextValue", "setState", "_hasScuFromHooks", "updateHookState", "p", "s", "c", "stateHooks", "filter", "x", "every", "prevScu", "call", "this", "shouldUpdate", "props", "forEach", "hookItem", "shouldComponentUpdate", "prevCWU", "componentWillUpdate", "__e", "tmp", "useEffect", "callback", "args", "state", "__s", "argsChanged", "_pendingArgs", "useRef", "initialValue", "currentHook", "useMemo", "current", "useMemo", "factory", "args", "state", "getHookState", "currentIndex", "argsChanged", "__H", "__", "__h", "useCallback", "callback", "currentHook", "flushAfterPaintEffects", "component", "afterPaintEffects", "shift", "__P", "__H", "__h", "forEach", "invokeCleanup", "invokeEffect", "e", "options", "__e", "__v", "__b", "vnode", "currentComponent", "oldBeforeDiff", "__", "parentDom", "__k", "__m", "oldRoot", "__r", "oldBeforeRender", "currentIndex", "hooks", "__c", "previousComponent", "hookItem", "__N", "_pendingArgs", "diffed", "oldAfterDiff", "c", "length", "push", "prevRaf", "requestAnimationFrame", "afterNextFrame", "commitQueue", "some", "filter", "cb", "oldCommit", "unmount", "oldBeforeUnmount", "hasErrored", "s", "HAS_RAF", "callback", "raf", "done", "clearTimeout", "timeout", "cancelAnimationFrame", "setTimeout", "hook", "comp", "cleanup", "argsChanged", "oldArgs", "newArgs", "arg", "index", "invokeOrReturn", "f", "startOfWeek", "date", "options", "defaultOptions", "getDefaultOptions", "weekStartsOn", "_date", "toDate", "day", "diff", "startOfISOWeek", "date", "startOfWeek", "getISOWeekYear", "date", "_date", "toDate", "year", "fourthOfJanuaryOfNextYear", "constructFrom", "startOfNextYear", "startOfISOWeek", "fourthOfJanuaryOfThisYear", "startOfThisYear", "startOfISOWeekYear", "date", "year", "getISOWeekYear", "fourthOfJanuary", "constructFrom", "startOfISOWeek", "addWeeks", "date", "amount", "days", "addDays", "isSameDay", "dateLeft", "dateRight", "dateLeftStartOfDay", "startOfDay", "dateRightStartOfDay", "isDate", "value", "isValid", "date", "isDate", "_date", "toDate", "startOfYear", "date", "cleanDate", "toDate", "_date", "constructFrom", "getDayOfYear", "date", "_date", "toDate", "differenceInCalendarDays", "startOfYear", "getISOWeek", "date", "_date", "toDate", "diff", "startOfISOWeek", "startOfISOWeekYear", "millisecondsInWeek", "getWeekYear", "date", "options", "_date", "toDate", "year", "defaultOptions", "getDefaultOptions", "firstWeekContainsDate", "firstWeekOfNextYear", "constructFrom", "startOfNextYear", "startOfWeek", "firstWeekOfThisYear", "startOfThisYear", "startOfWeekYear", "date", "options", "defaultOptions", "getDefaultOptions", "firstWeekContainsDate", "year", "getWeekYear", "firstWeek", "constructFrom", "startOfWeek", "getWeek", "date", "options", "_date", "toDate", "diff", "startOfWeek", "startOfWeekYear", "millisecondsInWeek", "addLeadingZeros", "number", "targetLength", "sign", "output", "lightFormatters", "date", "token", "signedYear", "year", "addLeadingZeros", "month", "dayPeriodEnumValue", "numberOfDigits", "milliseconds", "fractionalSeconds", "dayPeriodEnum", "formatters", "date", "token", "localize", "era", "signedYear", "year", "lightFormatters", "options", "signedWeekYear", "getWeekYear", "weekYear", "twoDigitYear", "addLeadingZeros", "isoWeekYear", "getISOWeekYear", "quarter", "month", "week", "getWeek", "isoWeek", "getISOWeek", "dayOfYear", "getDayOfYear", "dayOfWeek", "localDayOfWeek", "isoDayOfWeek", "dayPeriodEnumValue", "hours", "_localize", "timezoneOffset", "formatTimezoneWithOptionalMinutes", "formatTimezone", "formatTimezoneShort", "timestamp", "offset", "delimiter", "sign", "absOffset", "minutes", "dateLongFormatter", "pattern", "formatLong", "timeLongFormatter", "dateTimeLongFormatter", "matchResult", "datePattern", "timePattern", "dateTimeFormat", "longFormatters", "dayOfYearTokenRE", "weekYearTokenRE", "throwTokens", "isProtectedDayOfYearToken", "token", "isProtectedWeekYearToken", "warnOrThrowProtectedError", "format", "input", "_message", "message", "subject", "formattingTokensRegExp", "longFormattingTokensRegExp", "escapedStringRegExp", "doubleQuoteRegExp", "unescapedLatinCharacterRegExp", "format", "date", "formatStr", "options", "defaultOptions", "getDefaultOptions", "locale", "enUS", "firstWeekContainsDate", "weekStartsOn", "originalDate", "toDate", "isValid", "parts", "longFormattingTokensRegExp", "substring", "firstCharacter", "longFormatter", "longFormatters", "formattingTokensRegExp", "cleanEscapedString", "formatters", "unescapedLatinCharacterRegExp", "formatterOptions", "part", "token", "isProtectedWeekYearToken", "isProtectedDayOfYearToken", "warnOrThrowProtectedError", "formatter", "input", "matched", "escapedStringRegExp", "doubleQuoteRegExp", "getDay", "date", "toDate", "isAfter", "date", "dateToCompare", "_date", "toDate", "_dateToCompare", "isBefore", "date", "dateToCompare", "_date", "toDate", "_dateToCompare", "isSameWeek", "dateLeft", "dateRight", "options", "dateLeftStartOfWeek", "startOfWeek", "dateRightStartOfWeek", "isSameMonth", "dateLeft", "dateRight", "_dateLeft", "toDate", "_dateRight", "isThisWeek", "date", "options", "isSameWeek", "constructNow", "isToday", "date", "isSameDay", "constructNow", "isTomorrow", "date", "isSameDay", "addDays", "constructNow", "subDays", "date", "amount", "addDays", "nextDay", "date", "day", "delta", "getDay", "addDays", "nextMonday", "date", "nextDay", "previousDay", "date", "day", "delta", "getDay", "subDays", "previousMonday", "date", "previousDay", "startOfTomorrow", "now", "year", "month", "day", "date", "import_classnames", "PreviousMonthButton", "onPress", "disabled", "g", "classNames", "import_classnames", "NextMonthButton", "onPress", "disabled", "g", "classnames", "import_classnames", "WeekRow", "date", "month", "year", "week", "onClick", "firstDay", "hasMonday", "isFuture", "isAfter", "dateIsToday", "day", "today", "isSameDay", "datePickerIsSelectedDate", "d", "g", "classNames", "dayIndex", "DAY_NAMES", "MONTH_NAMES", "DATE_FORMAT", "formatDate", "date", "format", "groupArray", "array", "num", "group", "useOutsideClick", "ref", "onClickOut", "deps", "y", "onClick", "target", "WeekPicker", "initialDate", "open", "setOpen", "h", "setDate", "month", "setMonth", "year", "setYear", "blankDaysInMonth", "setBlankDaysInMonth", "daysInMonth", "setDaysInMonth", "containerRef", "A", "today", "formattedDate", "allDays", "day", "groupedDays", "atMaxMonth", "closeWithKeyboard", "toggleOpen", "q", "currentValue", "showCalendar", "datePickerCalculateDays", "totalDaysInMonth", "dayOfWeek", "dayIndex", "blankDaysArray", "i", "daysArray", "event", "selectThisWeek", "monday", "startOfWeek", "dateSelected", "selectLastWeek", "lastMonday", "previousMonday", "selectedDate", "url", "turbo_es2017_esm_exports", "datePickerDayClicked", "datePickerPreviousMonth", "datePickerNextMonth", "g", "PreviousMonthButton", "NextMonthButton", "WeekRow", "WeekFilterController", "Controller", "currentDate", "D", "g", "WeekPicker", "ScrollToBottomController", "Controller", "e", "t", "Ce", "Ke", "Xn", "o", "i", "ot", "s", "r", "Vn", "Lo", "y", "qn", "Ie", "Zn", "S", "X", "le", "A", "D", "te", "Gn", "yo", "wo", "V", "Po", "Qn", "No", "Fe", "Jn", "ei", "Eo", "dt", "u", "ti", "je", "ut", "vt", "oi", "ni", "ii", "si", "ht", "me", "Ro", "be", "pt", "ri", "d", "_d", "ai", "li", "Do", "ci", "di", "ui", "hi", "Fo", "jo", "he", "z", "Ho", "Oe", "J", "_e", "E", "_E", "b", "_b", "a", "l", "pi", "ft", "$o", "zo", "Uo", "Te", "gt", "He", "Wo", "Yo", "xo", "fi", "Bo", "_", "ee", "R", "_R", "p", "g", "f", "v", "T", "gi", "h", "c", "mi", "bi", "vi", "kt", "_kt", "ki", "yi", "wi", "Ko", "k", "m", "w", "x", "I", "C", "F", "N", "B", "O", "M", "q", "ie", "W", "ve", "se", "tt", "Yn", "Kn", "ko", "H", "Q", "Ei", "xi", "Bi", "Ci", "Ti", "Xo", "Si", "Ii", "yt", "wt", "Z", "Oi", "_i", "Mi", "Ai", "Li", "Pi", "Ni", "Ri", "Di", "Fi", "Vo", "ji", "Hi", "U", "Et", "$i", "$e", "ze", "zi", "Ui", "Wi", "qo", "K", "Yi", "Zo", "Ee", "ke", "ce", "_ce", "Ki", "Xi", "Vi", "qi", "Zi", "Gi", "Qi", "Ji", "Co", "es", "ts", "Go", "os", "ns", "is", "ss", "rs", "ne", "ye", "we", "as", "xt", "Y", "L", "re", "nt", "it", "Qo", "G", "$", "P", "fe", "To", "So", "Se", "Jo", "Ue", "st", "rt", "ls", "cs", "ds", "us", "en", "tn", "Bt", "hs", "on", "xe", "ps", "at", "lt", "fs", "gs", "nn", "ms", "sn", "bs", "vs", "ks", "ge", "ys", "ws", "rn", "Le", "Ct", "an", "Es", "ln", "xs", "Bs", "ae", "Pe", "cn", "pe", "We", "mt", "Tt", "Cs", "dn", "un", "Ne", "Re", "hn", "St", "Xe", "de", "It", "Ot", "Ts", "ue", "_t", "Ss", "pn", "Mt", "Is", "At", "Lt", "Os", "fn", "Pt", "_s", "gn", "Nt", "Rt", "Dt", "Ms", "Ps", "As", "Ls", "Ve", "Ft", "Ns", "mn", "jt", "Rs", "Ds", "Fs", "js", "Hs", "$s", "oe", "zs", "bn", "Us", "Ws", "De", "Ys", "Ks", "Xs", "bt", "Vs", "qs", "Zs", "Gs", "Qs", "Js", "er", "tr", "Ht", "ir", "or", "nr", "vn", "$t", "qe", "zt", "sr", "ar", "rr", "kn", "Ut", "cr", "lr", "Wt", "Yt", "Io", "yn", "dr", "wn", "Kt", "Ze", "Xt", "ur", "Ge", "Vt", "hr", "En", "pr", "fr", "gr", "xn", "qt", "Me", "yr", "mr", "br", "vr", "kr", "Bn", "Zt", "wr", "Gt", "Qt", "xr", "Er", "Cn", "Jt", "eo", "to", "Br", "oo", "no", "Or", "Cr", "Tr", "Sr", "Ir", "Ar", "_r", "Mr", "Tn", "io", "Pr", "Lr", "Sn", "so", "Rr", "Nr", "In", "ro", "Dr", "On", "ao", "Fr", "Qe", "Hr", "jr", "Ur", "$r", "zr", "_n", "Mn", "lo", "Yr", "Wr", "co", "Je", "Kr", "An", "et", "Xr", "Ln", "uo", "Zr", "Oo", "Vr", "qr", "Pn", "ho", "Jr", "Ae", "Gr", "Qr", "Nn", "po", "oa", "ea", "ta", "na", "ct", "_o", "Mo", "ia", "Ao", "sa", "ra", "aa", "Ye", "_Ye", "la", "ca", "da", "ua", "ha", "Rn", "Dn", "pa", "fa", "Be", "_Be", "ga", "ma", "ba", "va", "fo", "_fo", "go", "mo", "bo", "Fn", "jn", "ka", "ya", "j", "_j", "wa", "Ea", "Hn", "vo", "xa", "$n", "zn", "Un", "Ba", "Ca", "Ta", "Wn", "Sa", "Ia", "Oa", "_a", "Aa", "e", "n", "a", "l", "o", "h", "d", "u", "g", "v", "s", "i", "e", "t", "a", "o", "d", "r", "s", "i", "n", "t", "De", "He", "Re", "b", "Fe", "e", "n", "r", "i", "v", "P", "j", "We", "c", "T", "Ue", "ie", "C", "qe", "L", "S", "ze", "ae", "M", "Ge", "a", "l", "u", "d", "s", "le", "k", "w", "N", "Ke", "Qe", "Xe", "Ye", "y", "I", "Ve", "ue", "A", "Ze", "Je", "xe", "et", "tt", "nt", "o", "rt", "oe", "it", "at", "g", "lt", "ut", "ot", "O", "st", "ct", "dt", "ft", "pt", "vt", "gt", "f", "mt", "$", "_t", "bt", "yt", "se", "B", "_", "D", "ht", "Ot", "Et", "ce", "H", "jt", "Pt", "R", "F", "re", "de", "Tt", "fe", "W", "h", "U", "Ct", "E", "q", "Lt", "pe", "St", "Mt", "kt", "ve", "z", "p", "$t", "wt", "Nt", "It", "At", "ge", "G", "Bt", "K", "X", "Ht", "Dt", "me", "Y", "Q", "V", "Rt", "Z", "J", "zt", "Ft", "Wt", "Ut", "qt", "Xt", "Gt", "Kt", "be", "x", "Qt", "Yt", "ye", "ee", "Zt", "Vt", "_e", "te", "Jt", "he", "ne", "xt", "Oe", "Pe", "je", "Te", "Ce", "Le", "Se", "Me", "ke", "we", "Ne", "Ie", "Ae", "$e", "Be", "Ee", "m", "_m", "o", "R", "I", "L", "x", "B", "M", "C", "i", "a", "s", "S", "U", "D", "H", "e", "d", "v", "l", "n", "t", "f", "c", "u", "g", "y", "p", "w", "h", "b", "T", "E", "j", "F", "k", "q", "_", "O", "A", "P", "_P", "r", "e", "o", "g", "s", "i", "r", "l", "t", "p", "n", "h", "w", "m", "_m", "a", "c", "u", "d", "f", "r", "o", "e", "c", "d", "t", "i", "f", "g", "k", "n", "h", "m", "C", "a", "_a", "R", "b", "x", "S", "y", "L", "M", "v", "O", "T", "H", "A", "w", "_w", "B", "s", "E", "u", "p", "F", "l", "e", "n", "r", "s", "o", "t", "i", "a", "o", "t", "C", "O", "k", "w", "d", "v", "n", "e", "c", "i", "a", "s", "h", "u", "f", "y", "r", "p", "m", "b", "j", "g", "T", "E", "L", "_", "P", "R", "F", "I", "EditorController", "Controller", "api", "data", "event", "Aa", "v", "d", "m", "F", "a", "P", "I", "value", "container", "ArticleFormController", "Controller", "el", "content", "event", "_event", "file", "url", "DirectUpload", "error", "blob", "hiddenField", "request", "fileReader", "ZERO_WIDTH_UNICODE_CHAR", "e", "t", "i", "n", "logger", "isEnabled", "window", "TAGIFY_DEBUG", "log", "_len", "arguments", "length", "args", "Array", "_key", "console", "this", "_to_consumable_array", "warn", "sameStr", "s1", "s2", "caseSensitive", "trim", "toLowerCase", "removeCollectionProp", "collection", "unwantedProps", "isArray", "map", "v", "omit", "obj", "props", "p", "newObj", "indexOf", "parseHTML", "s", "DOMParser", "parseFromString", "body", "firstElementChild", "getfirstTextNode", "elm", "action", "nodeType", "escapeHTML", "replace", "isObject", "type", "Object", "prototype", "toString", "call", "split", "slice", "extend", "o", "o1", "o2", "copy", "a", "b", "key", "hasOwnProperty", "assign", "concatWithoutDups", "newArr", "existingObj", "_iteratorNormalCompletion", "_didIteratorError", "_iteratorError", "undefined", "_step", "_iterator", "Symbol", "iterator", "arr", "value", "_iteratorNormalCompletion1", "_didIteratorError1", "_iteratorError1", "_step1", "_iterator1", "item", "push", "includes", "err", "return", "unaccent", "String", "normalize", "isChromeAndroidBrowser", "test", "navigator", "userAgent", "getUID", "c", "crypto", "getRandomValues", "Uint8Array", "isNodeTag", "node", "isNodeBelongsToThisTagifyInstance", "classList", "contains", "settings", "classNames", "tag", "isWithinNodeTag", "closest", "tagSelector", "namespaceSelector", "DOM", "scope", "injectAtCaret", "content", "range", "selection", "getSelection", "getRangeAt", "document", "createTextNode", "deleteContents", "insertNode", "getSetTagData", "tagElm", "data", "override", "__tagifyTagData", "placeCaretAfterNode", "parentNode", "nextSibling", "sel", "rangeCount", "setStartAfter", "collapse", "removeAllRanges", "addRange", "fixCaretBetweenTags", "tags", "TagifyHasFocuse", "forEach", "previousSibling", "textNode", "before", "DEFAULTS", "delimiters", "pattern", "tagTextProp", "maxTags", "Infinity", "callbacks", "addTagOnBlur", "addTagOn", "onChangeAfterBlur", "duplicates", "whitelist", "blacklist", "enforceWhitelist", "userInput", "focusable", "keepInvalidTags", "createInvalidTags", "mixTagsAllowedAfter", "mixTagsInterpolator", "backspace", "skipInvalid", "pasteAsTags", "editTags", "clicks", "keepInvalid", "transformTag", "a11y", "focusableTags", "mixMode", "insertAfterTag", "autoComplete", "enabled", "rightKey", "tabKey", "namespace", "selectMode", "input", "focus", "tagNoAnimation", "tagInvalid", "tagNotAllowed", "scopeLoading", "hasMaxTags", "hasNoTags", "empty", "inputInvalid", "dropdown", "dropdownWrapper", "dropdownHeader", "dropdownFooter", "dropdownItem", "dropdownItemActive", "dropdownItemHidden", "dropdownItemSelected", "dropdownInital", "tagText", "tagX", "tagLoading", "tagEditing", "tagFlash", "tagHide", "classname", "maxItems", "searchKeys", "fuzzySearch", "accentedSearch", "includeSelectedTags", "highlightFirst", "closeOnSelect", "clearOnSelect", "position", "appendTarget", "hooks", "beforeRemoveTag", "Promise", "resolve", "beforePaste", "suggestionClick", "beforeKeyDown", "initDropdown", "_dropdown", "bind", "refs", "__tagify", "A", "C", "_object_spread_props", "suggestionsMethods", "events", "binding", "bindUnbind", "_CB", "_CBR", "listeners", "onKeyDown", "onMouseOver", "onMouseLeave", "onClick", "onScroll", "state", "hasFocus", "composing", "_s", "selectedElm", "querySelector", "dropdownItemActiveSelector", "selectedElmData", "getSuggestionDataByNode", "isMixMode", "mode", "isSelectMode", "tagify", "then", "result", "preventDefault", "dropdownItems", "_this", "getAllSuggestionsRefs", "actionUp", "getNextOrPrevOption", "matches", "dropdownItemSelector", "highlightOption", "itemsPerPage", "Math", "floor", "clientHeight", "offsetHeight", "isPageUp", "currentIndex", "targetIndex", "max", "min", "hide", "actions", "ArrowLeft", "shouldAutocompleteOnKey", "editing", "getMappedValue", "autoCompleteData", "autocomplete", "set", "selectOption", "setTimeout", "tagData", "suggestionElm", "nextOrPrevOption", "nextOrPrevOptionValue", "getAttribute", "getSuggestionNodeByValue", "addTags", "inputText", "catch", "raw", "charCodeAt", "removeTags", "editTag", "ddItem", "target", "button", "pos", "scrollTop", "scrollHeight", "trigger", "percentage", "round", "refilter", "query", "suggestedListItems", "filterListItems", "fill", "find", "selected", "next", "selectedIdx", "findIndex", "adjustScroll", "itemData", "className", "ddItemElm", "remove", "removeAttribute", "ddItemData", "suggest", "add", "setAttribute", "offsetTop", "event", "onSelect", "isNoMatch", "normalizedTagData", "normalizeTags", "onEditTagDone", "__isValid", "toggleFocusClass", "addEventListener", "fillHeaderFooter", "once", "selectAll", "onlyRendered", "tagsToAdd", "suggestions", "options", "whitelistItem", "valueIsInWhitelist", "searchBy", "isDuplicate", "niddle", "l", "startsWithMatch", "exactMatch", "_searchKeys", "keys", "some", "k", "_sd", "exact", "reduce", "values", "every", "q", "isTagDuplicate", "exactMatchesList", "sortby", "list", "unshift", "d", "suggestionsCount", "hasCustomSort", "filter", "_this1", "filteredList", "concat", "mapValueTo", "createListHTML", "sugegstionsList", "suggestion", "idx", "mappedValue", "templates", "apply", "join", "parseTemplate", "getHeaderRef", "getFooterRef", "querySelectorAll", "show", "firstListItem", "firstListItemValue", "noMatchListItem", "allowNewTags", "noWhitelist", "isManual", "dropdownItemNoMatch", "isLoading", "readonly", "clearTimeout", "dropdownHide__bindEventsTimeout", "visible", "setStateSelection", "render", "overrideManual", "_this_DOM", "removeEventListener", "removeChild", "flaggedTags", "baseOffset", "toggle", "getAppendTarget", "height", "clone", "ddHeight", "cloneNode", "style", "cssText", "appendChild", "HTMLContent", "dropdownContent", "innerHTML", "newHeaderElem", "newFooterElem", "headerRef", "footerRef", "replaceChild", "rect", "top", "bottom", "left", "width", "ancestorsOffsets", "isPlacedAbove", "hasSpaceOnRight", "cssTop", "cssLeft", "ddElm", "isRTL", "RTL", "isDefaultAppendTarget", "isSelfAppended", "appendTargetScrollTop", "pageYOffset", "root", "fullscreenElement", "webkitFullscreenElement", "documentElement", "viewportHeight", "viewportWidth", "clientWidth", "innerWidth", "positionTo", "ddTarget", "r2", "r", "startContainer", "offset", "startOffset", "createRange", "setStart", "setEnd", "getBoundingClientRect", "right", "getCaretGlobalPosition", "offsetLeft", "accumulatedAncestorsScrollTop", "getAccumulatedAncestorsScrollTop", "ceil", "placeAbove", "pageXOffset", "STORE_KEY", "TEXTS", "exceed", "duplicate", "notAllowed", "wrapper", "disabled", "required", "placeholder", "param", "title", "class", "getAttributes", "_t", "hasMore", "V", "R", "F", "H", "B", "W", "U", "customBinding", "customEventsList", "name", "on", "mainEvents", "eventName", "main", "bindGlobal", "isJQueryPlugin", "jQuery", "originalInput", "removeAllTags", "keydown", "onKeydown", "click", "onClickScope", "dblclick", "onDoubleClickScope", "paste", "onPaste", "drop", "onDrop", "compositionstart", "onCompositionStart", "compositionend", "onCompositionEnd", "inputMutationObserver", "MutationObserver", "onInputDOMChange", "disconnect", "observe", "childList", "bindOriginaInputListener", "delay", "DELAY", "clearInterval", "originalInputValueObserverInterval", "setInterval", "observeOriginalInputValue", "unbind", "global", "isIE", "cb", "onWindowKeyDown", "onFocusBlur", "onClickAnywhere", "useCapture", "unbindGlobal", "_this_value_", "_this_value", "nodeTag", "relatedTarget", "targetIsTagNode", "isTargetXBtn", "isFocused", "lostFocus", "Date", "text", "textContent", "currentDisplayValue", "ddEnabled", "eventData", "isTargetSelectOption", "isTargetAddNewBtn", "addNew", "postUpdate", "triggerChangeEvent", "dropdownCanBeShown", "condition2", "tagTextSelector", "setRangeAtStartEnd", "loading", "firstTagNode", "getTagElms", "nextTag", "focusedElm", "activeElement", "isBelong", "isInputNode", "isReadyOnlyTag", "hasAttribute", "isDropdownVisible", "nextElementSibling", "targetIsRemoveBtn", "deleteKeyTagDetected", "anchorOffset", "anchorNode", "prevAnchorSibling", "isCaretAfterTag", "el", "createElement", "enc", "innerText", "lastTagElems", "tagBeforeCaret", "tagElmToBeDeleted", "firstTextNodeBeforeTag", "isZWS", "nodeValue", "previousElementSibling", "_instanceof", "Element", "nodeName", "isManualDropdown", "blur", "inputSuggestion", "thingToAdd", "onInput", "onMixTagsInput", "showSuggestions", "inputElm", "validation", "validateTag", "toggleScopeValidation", "isValid", "search", "rangeText", "match", "matchedPatternCount", "matchFlaggedTag", "matchDelimiters", "lastTagsCount", "tagsElems", "fragment", "createDocumentFragment", "remainingTagsValues", "inputType", "createTagElem", "childNodes", "lastChild", "update", "withoutChangeEvent", "cloneRange", "focusNode", "endOffset", "lastIndexOf", "prefix", "onInputIE", "destroy", "tagifyValue", "loadOriginalValues", "closestTagifyDropdownElem", "dropdownSelector", "isScope", "timeDiffFocus", "index", "getNodeIndex", "fixFirefoxLastTagNoCaret", "clipboardData", "pastedText", "getData", "onEditTagInput", "editableElm", "_obj", "tagElmIdx", "textValue", "dataForChangedProp", "_define_property", "__tagId", "editTagChangeDetected", "originalIsValid", "newValue", "onEditTagPaste", "newNode", "onEditTagClick", "onEditTagFocus", "onEditTagBlur", "isRelatedTargetNodeTag", "newTagData", "originalData", "__originalData", "hasChanged", "_obj1", "message", "onEditTagkeydown", "__originalHTML", "EDITED_TAG_BLUR_DELAY", "isEditingTag", "editable", "m", "record", "addedNodes", "addedNode", "outerHTML", "replaceWith", "newlineText", "nextNode", "anythingAfterNode", "removedNodes", "removedNode", "lastInputChild", "z", "X", "J", "G", "$", "Tagify", "mockInstance", "Proxy", "get", "id", "instance", "callbacksPerType", "addRemove", "op", "ev", "removeAllCustomListeners", "entries", "cbArr", "off", "opts", "cloneData", "triggerHandler", "cloneEvent", "prop", "HTMLElement", "CustomEvent", "detail", "dispatchEvent", "isFirefox", "documentMode", "getPersistedData", "localStorage", "persistedData", "customKey", "getItem", "JSON", "parse", "setPersistedData", "setItem", "stringify", "Event", "clearPersistedData", "base", "removeItem", "applySettings", "build", "getCSSVars", "autofocus", "helpers", "dataProps", "template", "setContentEditable", "generateClassSelectors", "currentName", "defineProperty", "mergedDefaults", "attrVal", "RegExp", "_delimiters", "_object_spread", "texts", "persistedWhitelist", "attrs", "getCustomAttributes", "propName", "output", "compStyle", "getComputedStyle", "CSSVars", "tagHideTransition", "unit", "pop", "getPropertyValue", "labelWrapper", "integrated", "originalInput_tabIndex", "tabIndex", "inputSelector", "insertBefore", "_this_DOM_scope_parentNode", "blockChangeEvent", "persistedOriginalValue", "parseMixTags", "tagName", "insertAdjacentHTML", "lastOriginalValueReported", "clonedEvent", "toggleClass", "force", "setPlaceholder", "str", "changed", "bubbles", "simulated", "_valueTracker", "setValue", "random", "start", "getTagTextNode", "setTagTextNode", "HTML", "getLastTag", "tagIdx", "skipValidation", "editTagToggleValidity", "removeTagsFromValue", "previousData", "replaceTag", "reCheckInvalidTags", "getInvalidTagAttrs", "newTagElm", "updateValueByDOMTags", "clsNames", "skipNodesWithClassNames", "cls", "injectedNode", "_this_state_selection", "appendMixTags", "updateDOM", "hideDropdown", "validate", "source", "charAt", "suggestedText", "suggestionStart", "substr", "suggestionTrimmed", "substring", "dataSuggest", "replaceTextWithNode", "getTagIdx", "classess", "_sc", "tagNodes", "tagId", "dupsCount", "done", "getTagIndexByValue", "indices", "isCaseSensitive", "getTagElmByValue", "flashTag", "isTagBlacklisted", "x", "isTagWhitelisted", "getWhitelistItem", "_wi", "_wiv", "setReadonly", "attrribute", "contentEditable", "setDisabled", "isDisabled", "tagsItems", "_this_settings", "whitelistMatches", "whitelistWithProps", "isCollection", "mapStringToCollection", "acc", "trimmed", "itemCopy", "whitelistMatchesValues", "filteredItem", "matchObj", "tagsDataSet", "textProp", "preInterpolated", "maxTagsReached", "Error", "newWrapperNode", "strToReplace", "nodeToReplace", "nodeAtCaret", "firstSplitOffset", "splitText", "prepareNewTagNode", "aggregatedInvalidInput", "tagElmParams", "__preInvalidData", "postProcessNewTagNode", "selectTag", "lastTagElm", "appendTag", "addEmptyTag", "initialData", "clearInput", "tagElems", "frag", "addedTags", "addMixTags", "newTagNode", "tagsData", "prefixedTextToTag", "children", "_this_state_tag", "newTag", "createdFromDelimiters", "insertBeforeNode", "extraData", "templateData", "textnode", "iter", "createNodeIterator", "NodeFilter", "SHOW_TEXT", "tagValidation", "tagElms", "silent", "tranDuration", "tagsToRemove", "elms", "__removed", "removeNode", "parseFloat", "clientTop", "reason", "removeTagsFromDOM", "splice", "hasValue", "setOriginalInputValue", "debouncedUpdateTimeout", "inputValue", "getInputValue", "getCleanValue", "getMixedTagsAsString", "originalInputValueFormat", "that", "_interpolator", "iterateChildren", "rootNode", "removeTag", "TagsController", "Controller", "Q", "valuesArr", "item", "ToggleContentController", "Controller", "CheckboxButtonController", "Controller", "_event", "nextState", "taskElement", "import_classnames", "WeekRow", "date", "month", "year", "week", "onClick", "g", "day", "currentDate", "isFuture", "isAfter", "isDateToday", "isToday", "isCurrent", "isSelected", "isSameDay", "classNames", "import_classnames", "DAY_NAMES", "MONTH_NAMES", "formatDateText", "date", "isPast", "format", "isThisWeek", "isBefore", "addWeeks", "isSameMonth", "groupArray", "array", "num", "group", "useOutsideClick", "ref", "onClickOut", "deps", "y", "onClick", "target", "DateTimePicker", "initialDate", "defaultDate", "onChangeDate", "onChangeTime", "open", "setOpen", "h", "setDate", "month", "setMonth", "year", "setYear", "blankDaysInMonth", "setBlankDaysInMonth", "daysInMonth", "setDaysInMonth", "containerRef", "A", "today", "isDateToday", "isToday", "isDateTomorrow", "isTomorrow", "allDays", "day", "groupedDays", "atMinMonth", "closeWithKeyboard", "toggleOpen", "q", "currentValue", "datePickerCalculateDays", "totalDaysInMonth", "dayOfWeek", "dayIndex", "blankDaysArray", "i", "daysArray", "event", "onDateClick", "selectToday", "selectTomorrow", "addDays", "selectNextWeek", "nextMonday", "clearDate", "datePickerPreviousMonth", "datePickerNextMonth", "g", "classNames", "startOfTomorrow", "PreviousMonthButton", "NextMonthButton", "WeekRow", "DateTimePickerController", "Controller", "date", "format", "time", "D", "g", "DateTimePicker", "AssigneePickerController", "Controller", "event", "id", "name", "avatar", "AutoSubmitController", "Controller", "LinkController", "Controller", "frame", "turbo_es2017_esm_exports", "application", "dashboard_controller_default", "date_filter_controller_default", "NestedFormController", "award_form_controller_default", "search_form_controller_default", "DropdownController", "i", "turbo_modal_controller_default", "transition_controller_default", "grouped_select_controller_default", "chart_controller_default", "app_controller_default", "filters_controller_default", "fireworks_controller_default", "sortable_controller_default", "h", "permissions_controller_default", "turbo_controller_default", "custom_field_form_default", "command_palette_controller_default", "TimeDistanceController", "message_composer_controller_default", "messages_list_controller_default", "note_composer_controller_default", "CancellationFormController", "WeighInController", "CurrentConversationController", "TooltipController", "ModalController", "AvatarPickerController", "WeekFilterController", "ScrollToBottomController", "EditorController", "ArticleFormController", "TagsController", "index_m_default", "ToggleContentController", "AutosizeController", "CheckboxButtonController", "AssigneePickerController", "DateTimePickerController", "AutoSubmitController", "LinkController", "scroll_into_view", "alignToTop", "block", "inline", "behavior", "element", "options", "set_theme", "theme", "turbo_clear_cache", "start", "turbo_es2017_esm_exports", "message", "element", "dialogId", "dialog", "resolve", "set_theme", "scroll_into_view", "turbo_clear_cache", "e", "isSystem", "wantsDark"] }